From f4b2dda909a384ffcbe55b1498fe4e0259d09bcf Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 18 Oct 2023 18:36:15 +0000 Subject: [PATCH] feat: [discoveryengine] add v1alpha public library for discoveryengine (#9953) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 572280880 Source-Link: https://togithub.com/googleapis/googleapis/commit/f5cacaf0364606541f64c26e87370214f1199907 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/036171b68de5829f5cfa92949484cfcb7f00af28 Copy-Tag: eyJwIjoiamF2YS1kaXNjb3ZlcnllbmdpbmUvLk93bEJvdC55YW1sIiwiaCI6IjAzNjE3MWI2OGRlNTgyOWY1Y2ZhOTI5NDk0ODRjZmNiN2YwMGFmMjgifQ== --- java-discoveryengine/README.md | 4 +- .../google-cloud-discoveryengine-bom/pom.xml | 10 + .../google-cloud-discoveryengine/pom.xml | 9 + .../v1alpha/CompletionServiceClient.java | 281 + .../v1alpha/CompletionServiceSettings.java | 208 + .../ConversationalSearchServiceClient.java | 1193 + .../ConversationalSearchServiceSettings.java | 279 + .../v1alpha/DocumentServiceClient.java | 1257 + .../v1alpha/DocumentServiceSettings.java | 304 + .../v1alpha/RecommendationServiceClient.java | 290 + .../RecommendationServiceSettings.java | 209 + .../v1alpha/SchemaServiceClient.java | 1033 + .../v1alpha/SchemaServiceSettings.java | 291 + .../v1alpha/SearchServiceClient.java | 483 + .../v1alpha/SearchServiceSettings.java | 210 + .../SiteSearchEngineServiceClient.java | 340 + .../SiteSearchEngineServiceSettings.java | 225 + .../v1alpha/UserEventServiceClient.java | 598 + .../v1alpha/UserEventServiceSettings.java | 269 + .../v1alpha/gapic_metadata.json | 159 + .../discoveryengine/v1alpha/package-info.java | 250 + .../v1alpha/stub/CompletionServiceStub.java | 42 + .../stub/CompletionServiceStubSettings.java | 331 + .../stub/ConversationalSearchServiceStub.java | 79 + ...nversationalSearchServiceStubSettings.java | 543 + .../v1alpha/stub/DocumentServiceStub.java | 106 + .../stub/DocumentServiceStubSettings.java | 661 + .../GrpcCompletionServiceCallableFactory.java | 115 + .../stub/GrpcCompletionServiceStub.java | 166 + ...rsationalSearchServiceCallableFactory.java | 115 + .../GrpcConversationalSearchServiceStub.java | 360 + .../GrpcDocumentServiceCallableFactory.java | 115 + .../v1alpha/stub/GrpcDocumentServiceStub.java | 400 + ...cRecommendationServiceCallableFactory.java | 115 + .../stub/GrpcRecommendationServiceStub.java | 164 + .../GrpcSchemaServiceCallableFactory.java | 115 + .../v1alpha/stub/GrpcSchemaServiceStub.java | 338 + .../GrpcSearchServiceCallableFactory.java | 115 + .../v1alpha/stub/GrpcSearchServiceStub.java | 171 + ...iteSearchEngineServiceCallableFactory.java | 115 + .../stub/GrpcSiteSearchEngineServiceStub.java | 181 + .../GrpcUserEventServiceCallableFactory.java | 115 + .../stub/GrpcUserEventServiceStub.java | 296 + ...pJsonCompletionServiceCallableFactory.java | 105 + .../stub/HttpJsonCompletionServiceStub.java | 211 + ...rsationalSearchServiceCallableFactory.java | 105 + ...tpJsonConversationalSearchServiceStub.java | 555 + ...ttpJsonDocumentServiceCallableFactory.java | 105 + .../stub/HttpJsonDocumentServiceStub.java | 781 + ...nRecommendationServiceCallableFactory.java | 105 + .../HttpJsonRecommendationServiceStub.java | 210 + .../HttpJsonSchemaServiceCallableFactory.java | 105 + .../stub/HttpJsonSchemaServiceStub.java | 665 + .../HttpJsonSearchServiceCallableFactory.java | 105 + .../stub/HttpJsonSearchServiceStub.java | 216 + ...iteSearchEngineServiceCallableFactory.java | 105 + .../HttpJsonSiteSearchEngineServiceStub.java | 380 + ...tpJsonUserEventServiceCallableFactory.java | 105 + .../stub/HttpJsonUserEventServiceStub.java | 589 + .../stub/RecommendationServiceStub.java | 42 + .../RecommendationServiceStubSettings.java | 330 + .../v1alpha/stub/SchemaServiceStub.java | 99 + .../stub/SchemaServiceStubSettings.java | 634 + .../v1alpha/stub/SearchServiceStub.java | 48 + .../stub/SearchServiceStubSettings.java | 391 + .../stub/SiteSearchEngineServiceStub.java | 59 + .../SiteSearchEngineServiceStubSettings.java | 371 + .../v1alpha/stub/UserEventServiceStub.java | 84 + .../stub/UserEventServiceStubSettings.java | 525 + .../reflect-config.json | 3305 +++ .../CompletionServiceClientHttpJsonTest.java | 139 + .../v1alpha/CompletionServiceClientTest.java | 145 + ...tionalSearchServiceClientHttpJsonTest.java | 662 + ...ConversationalSearchServiceClientTest.java | 583 + .../DocumentServiceClientHttpJsonTest.java | 724 + .../v1alpha/DocumentServiceClientTest.java | 651 + .../v1alpha/MockCompletionService.java | 59 + .../v1alpha/MockCompletionServiceImpl.java | 81 + .../MockConversationalSearchService.java | 59 + .../MockConversationalSearchServiceImpl.java | 189 + .../v1alpha/MockDocumentService.java | 59 + .../v1alpha/MockDocumentServiceImpl.java | 208 + .../v1alpha/MockLocations.java | 59 + .../v1alpha/MockLocationsImpl.java | 59 + .../v1alpha/MockRecommendationService.java | 59 + .../MockRecommendationServiceImpl.java | 81 + .../v1alpha/MockSchemaService.java | 59 + .../v1alpha/MockSchemaServiceImpl.java | 165 + .../v1alpha/MockSearchService.java | 59 + .../v1alpha/MockSearchServiceImpl.java | 80 + .../v1alpha/MockSiteSearchEngineService.java | 59 + .../MockSiteSearchEngineServiceImpl.java | 81 + .../v1alpha/MockUserEventService.java | 59 + .../v1alpha/MockUserEventServiceImpl.java | 146 + ...commendationServiceClientHttpJsonTest.java | 147 + .../RecommendationServiceClientTest.java | 154 + .../SchemaServiceClientHttpJsonTest.java | 573 + .../v1alpha/SchemaServiceClientTest.java | 528 + .../SearchServiceClientHttpJsonTest.java | 189 + .../v1alpha/SearchServiceClientTest.java | 209 + ...SearchEngineServiceClientHttpJsonTest.java | 140 + .../SiteSearchEngineServiceClientTest.java | 147 + .../UserEventServiceClientHttpJsonTest.java | 350 + .../v1alpha/UserEventServiceClientTest.java | 350 + .../pom.xml | 45 + .../v1alpha/CompletionServiceGrpc.java | 382 + .../ConversationalSearchServiceGrpc.java | 1057 + .../v1alpha/DocumentServiceGrpc.java | 1174 + .../v1alpha/RecommendationServiceGrpc.java | 381 + .../v1alpha/SchemaServiceGrpc.java | 839 + .../v1alpha/SearchServiceGrpc.java | 375 + .../v1alpha/SiteSearchEngineServiceGrpc.java | 377 + .../v1alpha/UserEventServiceGrpc.java | 766 + java-discoveryengine/pom.xml | 12 + .../clirr-ignored-differences.xml | 19 + .../pom.xml | 37 + .../v1alpha/BigQuerySource.java | 1893 ++ .../v1alpha/BigQuerySourceOrBuilder.java | 237 + .../discoveryengine/v1alpha/BranchName.java | 427 + .../v1alpha/CollectUserEventRequest.java | 1230 + .../CollectUserEventRequestOrBuilder.java | 158 + .../discoveryengine/v1alpha/CommonProto.java | 150 + .../v1alpha/CompleteQueryRequest.java | 1515 + .../CompleteQueryRequestOrBuilder.java | 207 + .../v1alpha/CompleteQueryResponse.java | 2226 ++ .../CompleteQueryResponseOrBuilder.java | 114 + .../v1alpha/CompletionInfo.java | 735 + .../v1alpha/CompletionInfoOrBuilder.java | 67 + .../v1alpha/CompletionServiceProto.java | 138 + .../discoveryengine/v1alpha/Conversation.java | 2179 ++ .../v1alpha/ConversationContext.java | 926 + .../v1alpha/ConversationContextOrBuilder.java | 107 + .../v1alpha/ConversationMessage.java | 1399 + .../v1alpha/ConversationMessageOrBuilder.java | 135 + .../v1alpha/ConversationName.java | 432 + .../v1alpha/ConversationOrBuilder.java | 231 + .../v1alpha/ConversationProto.java | 183 + .../ConversationalSearchServiceProto.java | 304 + .../v1alpha/ConverseConversationRequest.java | 2387 ++ .../ConverseConversationRequestOrBuilder.java | 369 + .../v1alpha/ConverseConversationResponse.java | 1844 ++ ...ConverseConversationResponseOrBuilder.java | 211 + .../v1alpha/CreateConversationRequest.java | 949 + .../CreateConversationRequestOrBuilder.java | 97 + .../v1alpha/CreateDocumentRequest.java | 1252 + .../CreateDocumentRequestOrBuilder.java | 157 + .../v1alpha/CreateSchemaMetadata.java | 978 + .../CreateSchemaMetadataOrBuilder.java | 98 + .../v1alpha/CreateSchemaRequest.java | 1186 + .../v1alpha/CreateSchemaRequestOrBuilder.java | 139 + .../v1alpha/CustomAttribute.java | 1164 + .../v1alpha/CustomAttributeOrBuilder.java | 175 + .../v1alpha/DataStoreName.java | 371 + .../v1alpha/DeleteConversationRequest.java | 657 + .../DeleteConversationRequestOrBuilder.java | 56 + .../v1alpha/DeleteDocumentRequest.java | 712 + .../DeleteDocumentRequestOrBuilder.java | 72 + .../v1alpha/DeleteSchemaMetadata.java | 978 + .../DeleteSchemaMetadataOrBuilder.java | 98 + .../v1alpha/DeleteSchemaRequest.java | 654 + .../v1alpha/DeleteSchemaRequestOrBuilder.java | 56 + .../discoveryengine/v1alpha/Document.java | 3806 +++ .../discoveryengine/v1alpha/DocumentInfo.java | 1731 ++ .../v1alpha/DocumentInfoOrBuilder.java | 247 + .../discoveryengine/v1alpha/DocumentName.java | 485 + .../v1alpha/DocumentOrBuilder.java | 320 + .../v1alpha/DocumentProto.java | 123 + .../v1alpha/DocumentServiceProto.java | 251 + .../discoveryengine/v1alpha/DoubleList.java | 684 + .../v1alpha/DoubleListOrBuilder.java | 63 + .../discoveryengine/v1alpha/FieldConfig.java | 4108 +++ .../v1alpha/FieldConfigOrBuilder.java | 521 + .../discoveryengine/v1alpha/GcsSource.java | 1153 + .../v1alpha/GcsSourceOrBuilder.java | 175 + .../v1alpha/GetConversationRequest.java | 653 + .../GetConversationRequestOrBuilder.java | 56 + .../v1alpha/GetDocumentRequest.java | 706 + .../v1alpha/GetDocumentRequestOrBuilder.java | 72 + .../v1alpha/GetSchemaRequest.java | 650 + .../v1alpha/GetSchemaRequestOrBuilder.java | 56 + .../v1alpha/ImportConfigProto.java | 292 + .../v1alpha/ImportDocumentsMetadata.java | 1169 + .../ImportDocumentsMetadataOrBuilder.java | 124 + .../v1alpha/ImportDocumentsRequest.java | 3997 +++ .../ImportDocumentsRequestOrBuilder.java | 355 + .../v1alpha/ImportDocumentsResponse.java | 1209 + .../ImportDocumentsResponseOrBuilder.java | 111 + .../v1alpha/ImportErrorConfig.java | 784 + .../v1alpha/ImportErrorConfigOrBuilder.java | 73 + .../v1alpha/ImportUserEventsMetadata.java | 1171 + .../ImportUserEventsMetadataOrBuilder.java | 124 + .../v1alpha/ImportUserEventsRequest.java | 3041 ++ .../ImportUserEventsRequestOrBuilder.java | 208 + .../v1alpha/ImportUserEventsResponse.java | 1411 + .../ImportUserEventsResponseOrBuilder.java | 141 + .../discoveryengine/v1alpha/Interval.java | 1149 + .../v1alpha/IntervalOrBuilder.java | 129 + .../v1alpha/ListConversationsRequest.java | 1396 + .../ListConversationsRequestOrBuilder.java | 173 + .../v1alpha/ListConversationsResponse.java | 1146 + .../ListConversationsResponseOrBuilder.java | 103 + .../v1alpha/ListDocumentsRequest.java | 1061 + .../ListDocumentsRequestOrBuilder.java | 131 + .../v1alpha/ListDocumentsResponse.java | 1159 + .../ListDocumentsResponseOrBuilder.java | 108 + .../v1alpha/ListSchemasRequest.java | 995 + .../v1alpha/ListSchemasRequestOrBuilder.java | 113 + .../v1alpha/ListSchemasResponse.java | 1150 + .../v1alpha/ListSchemasResponseOrBuilder.java | 108 + .../discoveryengine/v1alpha/MediaInfo.java | 933 + .../v1alpha/MediaInfoOrBuilder.java | 111 + .../discoveryengine/v1alpha/PageInfo.java | 1366 + .../v1alpha/PageInfoOrBuilder.java | 181 + .../discoveryengine/v1alpha/PanelInfo.java | 1103 + .../v1alpha/PanelInfoOrBuilder.java | 137 + .../v1alpha/PurgeConfigProto.java | 164 + .../v1alpha/PurgeDocumentsMetadata.java | 1169 + .../PurgeDocumentsMetadataOrBuilder.java | 124 + .../v1alpha/PurgeDocumentsRequest.java | 949 + .../PurgeDocumentsRequestOrBuilder.java | 99 + .../v1alpha/PurgeDocumentsResponse.java | 852 + .../PurgeDocumentsResponseOrBuilder.java | 97 + .../v1alpha/PurgeUserEventsMetadata.java | 1169 + .../PurgeUserEventsMetadataOrBuilder.java | 124 + .../v1alpha/PurgeUserEventsRequest.java | 1123 + .../PurgeUserEventsRequestOrBuilder.java | 149 + .../v1alpha/PurgeUserEventsResponse.java | 546 + .../PurgeUserEventsResponseOrBuilder.java | 38 + .../v1alpha/RecommendRequest.java | 2819 ++ .../v1alpha/RecommendRequestOrBuilder.java | 583 + .../v1alpha/RecommendResponse.java | 3138 +++ .../v1alpha/RecommendResponseOrBuilder.java | 199 + .../v1alpha/RecommendationServiceProto.java | 213 + .../v1alpha/RecrawlUrisMetadata.java | 1664 ++ .../v1alpha/RecrawlUrisMetadataOrBuilder.java | 210 + .../v1alpha/RecrawlUrisRequest.java | 980 + .../v1alpha/RecrawlUrisRequestOrBuilder.java | 123 + .../v1alpha/RecrawlUrisResponse.java | 3742 +++ .../v1alpha/RecrawlUrisResponseOrBuilder.java | 143 + .../cloud/discoveryengine/v1alpha/Reply.java | 2565 ++ .../v1alpha/ReplyOrBuilder.java | 161 + .../cloud/discoveryengine/v1alpha/Schema.java | 1808 ++ .../discoveryengine/v1alpha/SchemaName.java | 427 + .../v1alpha/SchemaOrBuilder.java | 194 + .../discoveryengine/v1alpha/SchemaProto.java | 153 + .../v1alpha/SchemaServiceProto.java | 272 + .../discoveryengine/v1alpha/SearchInfo.java | 1166 + .../v1alpha/SearchInfoOrBuilder.java | 168 + .../v1alpha/SearchRequest.java | 23202 ++++++++++++++++ .../v1alpha/SearchRequestOrBuilder.java | 1010 + .../v1alpha/SearchResponse.java | 15113 ++++++++++ .../v1alpha/SearchResponseOrBuilder.java | 500 + .../v1alpha/SearchServiceProto.java | 660 + .../v1alpha/ServingConfigName.java | 566 + .../v1alpha/SiteSearchEngineName.java | 374 + .../v1alpha/SiteSearchEngineServiceProto.java | 192 + .../discoveryengine/v1alpha/SolutionType.java | 200 + .../discoveryengine/v1alpha/TextInput.java | 895 + .../v1alpha/TextInputOrBuilder.java | 85 + .../v1alpha/TransactionInfo.java | 1504 + .../v1alpha/TransactionInfoOrBuilder.java | 233 + .../v1alpha/UpdateConversationRequest.java | 1077 + .../UpdateConversationRequestOrBuilder.java | 119 + .../v1alpha/UpdateDocumentRequest.java | 955 + .../UpdateDocumentRequestOrBuilder.java | 109 + .../v1alpha/UpdateSchemaMetadata.java | 978 + .../UpdateSchemaMetadataOrBuilder.java | 98 + .../v1alpha/UpdateSchemaRequest.java | 856 + .../v1alpha/UpdateSchemaRequestOrBuilder.java | 85 + .../discoveryengine/v1alpha/UserEvent.java | 6448 +++++ .../v1alpha/UserEventOrBuilder.java | 1085 + .../v1alpha/UserEventProto.java | 268 + .../v1alpha/UserEventServiceProto.java | 167 + .../discoveryengine/v1alpha/UserInfo.java | 946 + .../v1alpha/UserInfoOrBuilder.java | 115 + .../v1alpha/WriteUserEventRequest.java | 955 + .../WriteUserEventRequestOrBuilder.java | 97 + .../discoveryengine/v1alpha/common.proto | 155 + .../v1alpha/completion_service.proto | 134 + .../v1alpha/conversation.proto | 138 + .../conversational_search_service.proto | 306 + .../discoveryengine/v1alpha/document.proto | 121 + .../v1alpha/document_service.proto | 318 + .../v1alpha/import_config.proto | 343 + .../v1alpha/purge_config.proto | 159 + .../v1alpha/recommendation_service.proto | 221 + .../discoveryengine/v1alpha/schema.proto | 312 + .../v1alpha/schema_service.proto | 260 + .../v1alpha/search_service.proto | 851 + .../v1alpha/site_search_engine_service.proto | 152 + .../discoveryengine/v1alpha/user_event.proto | 475 + .../v1alpha/user_event_service.proto | 154 + .../completequery/AsyncCompleteQuery.java | 57 + .../completequery/SyncCompleteQuery.java | 53 + .../SyncCreateSetCredentialsProvider.java | 45 + .../SyncCreateSetCredentialsProvider1.java | 41 + .../create/SyncCreateSetEndpoint.java | 42 + .../completequery/SyncCompleteQuery.java | 49 + .../AsyncConverseConversation.java | 68 + .../SyncConverseConversation.java | 65 + ...ConversationConversationnameTextinput.java | 48 + ...ncConverseConversationStringTextinput.java | 49 + .../SyncCreateSetCredentialsProvider.java | 45 + .../SyncCreateSetCredentialsProvider1.java | 41 + .../create/SyncCreateSetEndpoint.java | 42 + .../AsyncCreateConversation.java | 55 + .../SyncCreateConversation.java | 51 + ...ConversationDatastorenameConversation.java | 46 + ...cCreateConversationStringConversation.java | 47 + .../AsyncDeleteConversation.java | 54 + .../SyncDeleteConversation.java | 50 + ...yncDeleteConversationConversationname.java | 45 + .../SyncDeleteConversationString.java | 46 + .../getconversation/AsyncGetConversation.java | 54 + .../getconversation/SyncGetConversation.java | 50 + .../SyncGetConversationConversationname.java | 45 + .../SyncGetConversationString.java | 46 + .../AsyncListConversations.java | 60 + .../AsyncListConversationsPaged.java | 68 + .../SyncListConversations.java | 57 + .../SyncListConversationsDatastorename.java | 47 + .../SyncListConversationsString.java | 48 + .../AsyncUpdateConversation.java | 52 + .../SyncUpdateConversation.java | 48 + ...dateConversationConversationFieldmask.java | 45 + .../SyncConverseConversation.java | 50 + .../SyncCreateSetCredentialsProvider.java | 45 + .../SyncCreateSetCredentialsProvider1.java | 41 + .../create/SyncCreateSetEndpoint.java | 42 + .../createdocument/AsyncCreateDocument.java | 55 + .../createdocument/SyncCreateDocument.java | 51 + ...reateDocumentBranchnameDocumentString.java | 46 + ...yncCreateDocumentStringDocumentString.java | 47 + .../deletedocument/AsyncDeleteDocument.java | 52 + .../deletedocument/SyncDeleteDocument.java | 49 + .../SyncDeleteDocumentDocumentname.java | 44 + .../SyncDeleteDocumentString.java | 45 + .../getdocument/AsyncGetDocument.java | 52 + .../getdocument/SyncGetDocument.java | 49 + .../SyncGetDocumentDocumentname.java | 44 + .../getdocument/SyncGetDocumentString.java | 45 + .../importdocuments/AsyncImportDocuments.java | 57 + .../AsyncImportDocumentsLRO.java | 58 + .../importdocuments/SyncImportDocuments.java | 53 + .../listdocuments/AsyncListDocuments.java | 57 + .../AsyncListDocumentsPaged.java | 65 + .../listdocuments/SyncListDocuments.java | 53 + .../SyncListDocumentsBranchname.java | 46 + .../SyncListDocumentsString.java | 47 + .../purgedocuments/AsyncPurgeDocuments.java | 55 + .../AsyncPurgeDocumentsLRO.java | 56 + .../purgedocuments/SyncPurgeDocuments.java | 51 + .../updatedocument/AsyncUpdateDocument.java | 50 + .../updatedocument/SyncUpdateDocument.java | 46 + .../getdocument/SyncGetDocument.java | 49 + .../SyncCreateSetCredentialsProvider.java | 45 + .../SyncCreateSetCredentialsProvider1.java | 41 + .../create/SyncCreateSetEndpoint.java | 42 + .../recommend/AsyncRecommend.java | 63 + .../recommend/SyncRecommend.java | 59 + .../recommend/SyncRecommend.java | 50 + .../SyncCreateSetCredentialsProvider.java | 44 + .../SyncCreateSetCredentialsProvider1.java | 40 + .../create/SyncCreateSetEndpoint.java | 41 + .../createschema/AsyncCreateSchema.java | 55 + .../createschema/AsyncCreateSchemaLRO.java | 56 + .../createschema/SyncCreateSchema.java | 51 + ...CreateSchemaDatastorenameSchemaString.java | 45 + .../SyncCreateSchemaStringSchemaString.java | 46 + .../deleteschema/AsyncDeleteSchema.java | 52 + .../deleteschema/AsyncDeleteSchemaLRO.java | 54 + .../deleteschema/SyncDeleteSchema.java | 49 + .../SyncDeleteSchemaSchemaname.java | 44 + .../deleteschema/SyncDeleteSchemaString.java | 45 + .../getschema/AsyncGetSchema.java | 52 + .../getschema/SyncGetSchema.java | 49 + .../getschema/SyncGetSchemaSchemaname.java | 44 + .../getschema/SyncGetSchemaString.java | 45 + .../listschemas/AsyncListSchemas.java | 56 + .../listschemas/AsyncListSchemasPaged.java | 64 + .../listschemas/SyncListSchemas.java | 53 + .../SyncListSchemasDatastorename.java | 45 + .../listschemas/SyncListSchemasString.java | 46 + .../updateschema/AsyncUpdateSchema.java | 50 + .../updateschema/AsyncUpdateSchemaLRO.java | 51 + .../updateschema/SyncUpdateSchema.java | 46 + .../getschema/SyncGetSchema.java | 48 + .../SyncCreateSetCredentialsProvider.java | 44 + .../SyncCreateSetCredentialsProvider1.java | 40 + .../create/SyncCreateSetEndpoint.java | 41 + .../searchservice/search/AsyncSearch.java | 83 + .../search/AsyncSearchPaged.java | 89 + .../searchservice/search/SyncSearch.java | 79 + .../search/SyncSearch.java | 48 + .../SyncCreateSetCredentialsProvider.java | 45 + .../SyncCreateSetCredentialsProvider1.java | 41 + .../create/SyncCreateSetEndpoint.java | 42 + .../recrawluris/AsyncRecrawlUris.java | 56 + .../recrawluris/AsyncRecrawlUrisLRO.java | 57 + .../recrawluris/SyncRecrawlUris.java | 52 + .../recrawluris/SyncRecrawlUris.java | 50 + .../completequery/SyncCompleteQuery.java | 50 + .../SyncConverseConversation.java | 50 + .../getdocument/SyncGetDocument.java | 49 + .../recommend/SyncRecommend.java | 50 + .../getschema/SyncGetSchema.java | 49 + .../search/SyncSearch.java | 49 + .../recrawluris/SyncRecrawlUris.java | 50 + .../writeuserevent/SyncWriteUserEvent.java | 49 + .../AsyncCollectUserEvent.java | 56 + .../SyncCollectUserEvent.java | 52 + .../SyncCreateSetCredentialsProvider.java | 45 + .../SyncCreateSetCredentialsProvider1.java | 41 + .../create/SyncCreateSetEndpoint.java | 42 + .../AsyncImportUserEvents.java | 55 + .../AsyncImportUserEventsLRO.java | 56 + .../SyncImportUserEvents.java | 52 + .../purgeuserevents/AsyncPurgeUserEvents.java | 55 + .../AsyncPurgeUserEventsLRO.java | 56 + .../purgeuserevents/SyncPurgeUserEvents.java | 51 + .../writeuserevent/AsyncWriteUserEvent.java | 54 + .../writeuserevent/SyncWriteUserEvent.java | 50 + .../writeuserevent/SyncWriteUserEvent.java | 49 + versions.txt | 2 + 424 files changed, 205175 insertions(+), 2 deletions(-) create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceClient.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceSettings.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceClient.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceSettings.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceClient.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceSettings.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceClient.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceSettings.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceClient.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceSettings.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceClient.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceSettings.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceClient.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceSettings.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceClient.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceSettings.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/gapic_metadata.json create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/package-info.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/CompletionServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/CompletionServiceStubSettings.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/ConversationalSearchServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/ConversationalSearchServiceStubSettings.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/DocumentServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/DocumentServiceStubSettings.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcCompletionServiceCallableFactory.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcCompletionServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcConversationalSearchServiceCallableFactory.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcConversationalSearchServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcDocumentServiceCallableFactory.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcDocumentServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcRecommendationServiceCallableFactory.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcRecommendationServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSchemaServiceCallableFactory.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSchemaServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSearchServiceCallableFactory.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSearchServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSiteSearchEngineServiceCallableFactory.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSiteSearchEngineServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcUserEventServiceCallableFactory.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcUserEventServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonCompletionServiceCallableFactory.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonCompletionServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonConversationalSearchServiceCallableFactory.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonConversationalSearchServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonDocumentServiceCallableFactory.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonDocumentServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonRecommendationServiceCallableFactory.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonRecommendationServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonSchemaServiceCallableFactory.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonSchemaServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonSearchServiceCallableFactory.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonSearchServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonSiteSearchEngineServiceCallableFactory.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonSiteSearchEngineServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonUserEventServiceCallableFactory.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonUserEventServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/RecommendationServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/RecommendationServiceStubSettings.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SchemaServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SchemaServiceStubSettings.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SearchServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SearchServiceStubSettings.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SiteSearchEngineServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SiteSearchEngineServiceStubSettings.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/UserEventServiceStub.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/UserEventServiceStubSettings.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/main/resources/META-INF/native-image/com.google.cloud.discoveryengine.v1alpha/reflect-config.json create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceClientHttpJsonTest.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceClientTest.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceClientHttpJsonTest.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceClientTest.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceClientHttpJsonTest.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceClientTest.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockCompletionService.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockCompletionServiceImpl.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockConversationalSearchService.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockConversationalSearchServiceImpl.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockDocumentService.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockDocumentServiceImpl.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockLocations.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockLocationsImpl.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockRecommendationService.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockRecommendationServiceImpl.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSchemaService.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSchemaServiceImpl.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSearchService.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSearchServiceImpl.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSiteSearchEngineService.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSiteSearchEngineServiceImpl.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockUserEventService.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockUserEventServiceImpl.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceClientHttpJsonTest.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceClientTest.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceClientHttpJsonTest.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceClientTest.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceClientHttpJsonTest.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceClientTest.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceClientHttpJsonTest.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceClientTest.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceClientHttpJsonTest.java create mode 100644 java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceClientTest.java create mode 100644 java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/pom.xml create mode 100644 java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceGrpc.java create mode 100644 java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceGrpc.java create mode 100644 java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceGrpc.java create mode 100644 java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceGrpc.java create mode 100644 java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceGrpc.java create mode 100644 java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceGrpc.java create mode 100644 java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceGrpc.java create mode 100644 java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceGrpc.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/clirr-ignored-differences.xml create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/pom.xml create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/BigQuerySource.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/BigQuerySourceOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/BranchName.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CollectUserEventRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CollectUserEventRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CommonProto.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompleteQueryRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompleteQueryRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompleteQueryResponse.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompleteQueryResponseOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionInfo.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionInfoOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceProto.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/Conversation.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationContext.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationContextOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationMessage.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationMessageOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationName.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationProto.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceProto.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConverseConversationRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConverseConversationRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConverseConversationResponse.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConverseConversationResponseOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateConversationRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateConversationRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateDocumentRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateDocumentRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateSchemaMetadata.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateSchemaMetadataOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateSchemaRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateSchemaRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CustomAttribute.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CustomAttributeOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DataStoreName.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteConversationRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteConversationRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteDocumentRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteDocumentRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteSchemaMetadata.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteSchemaMetadataOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteSchemaRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteSchemaRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/Document.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentInfo.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentInfoOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentName.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentProto.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceProto.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DoubleList.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DoubleListOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/FieldConfig.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/FieldConfigOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GcsSource.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GcsSourceOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetConversationRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetConversationRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetDocumentRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetDocumentRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetSchemaRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetSchemaRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportConfigProto.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsMetadata.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsMetadataOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsResponse.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsResponseOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportErrorConfig.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportErrorConfigOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsMetadata.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsMetadataOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsResponse.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsResponseOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/Interval.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/IntervalOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListConversationsRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListConversationsRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListConversationsResponse.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListConversationsResponseOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListDocumentsRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListDocumentsRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListDocumentsResponse.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListDocumentsResponseOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListSchemasRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListSchemasRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListSchemasResponse.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListSchemasResponseOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/MediaInfo.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/MediaInfoOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PageInfo.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PageInfoOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PanelInfo.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PanelInfoOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeConfigProto.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsMetadata.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsMetadataOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsResponse.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsResponseOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsMetadata.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsMetadataOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsResponse.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsResponseOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendResponse.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendResponseOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceProto.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisMetadata.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisMetadataOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisResponse.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisResponseOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/Reply.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ReplyOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/Schema.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaName.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaProto.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceProto.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchInfo.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchInfoOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchResponse.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchResponseOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceProto.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ServingConfigName.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineName.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceProto.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SolutionType.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/TextInput.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/TextInputOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/TransactionInfo.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/TransactionInfoOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateConversationRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateConversationRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateDocumentRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateDocumentRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateSchemaMetadata.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateSchemaMetadataOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateSchemaRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateSchemaRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEvent.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventProto.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceProto.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserInfo.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserInfoOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/WriteUserEventRequest.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/WriteUserEventRequestOrBuilder.java create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/common.proto create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/completion_service.proto create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/conversation.proto create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/conversational_search_service.proto create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/document.proto create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/document_service.proto create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/import_config.proto create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/purge_config.proto create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/recommendation_service.proto create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/schema.proto create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/schema_service.proto create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/search_service.proto create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/site_search_engine_service.proto create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/user_event.proto create mode 100644 java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/user_event_service.proto create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservice/completequery/AsyncCompleteQuery.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservice/completequery/SyncCompleteQuery.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservice/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservice/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservice/create/SyncCreateSetEndpoint.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservicesettings/completequery/SyncCompleteQuery.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/converseconversation/AsyncConverseConversation.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/converseconversation/SyncConverseConversation.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/converseconversation/SyncConverseConversationConversationnameTextinput.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/converseconversation/SyncConverseConversationStringTextinput.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/create/SyncCreateSetEndpoint.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/createconversation/AsyncCreateConversation.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/createconversation/SyncCreateConversation.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/createconversation/SyncCreateConversationDatastorenameConversation.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/createconversation/SyncCreateConversationStringConversation.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/deleteconversation/AsyncDeleteConversation.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/deleteconversation/SyncDeleteConversation.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/deleteconversation/SyncDeleteConversationConversationname.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/deleteconversation/SyncDeleteConversationString.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/getconversation/AsyncGetConversation.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/getconversation/SyncGetConversation.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/getconversation/SyncGetConversationConversationname.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/getconversation/SyncGetConversationString.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/listconversations/AsyncListConversations.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/listconversations/AsyncListConversationsPaged.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/listconversations/SyncListConversations.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/listconversations/SyncListConversationsDatastorename.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/listconversations/SyncListConversationsString.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/updateconversation/AsyncUpdateConversation.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/updateconversation/SyncUpdateConversation.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/updateconversation/SyncUpdateConversationConversationFieldmask.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservicesettings/converseconversation/SyncConverseConversation.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/create/SyncCreateSetEndpoint.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/createdocument/AsyncCreateDocument.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/createdocument/SyncCreateDocument.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/createdocument/SyncCreateDocumentBranchnameDocumentString.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/createdocument/SyncCreateDocumentStringDocumentString.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/deletedocument/AsyncDeleteDocument.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/deletedocument/SyncDeleteDocument.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/deletedocument/SyncDeleteDocumentDocumentname.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/deletedocument/SyncDeleteDocumentString.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/getdocument/AsyncGetDocument.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/getdocument/SyncGetDocument.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/getdocument/SyncGetDocumentDocumentname.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/getdocument/SyncGetDocumentString.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/importdocuments/AsyncImportDocuments.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/importdocuments/AsyncImportDocumentsLRO.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/importdocuments/SyncImportDocuments.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/listdocuments/AsyncListDocuments.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/listdocuments/AsyncListDocumentsPaged.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/listdocuments/SyncListDocuments.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/listdocuments/SyncListDocumentsBranchname.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/listdocuments/SyncListDocumentsString.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/purgedocuments/AsyncPurgeDocuments.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/purgedocuments/AsyncPurgeDocumentsLRO.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/purgedocuments/SyncPurgeDocuments.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/updatedocument/AsyncUpdateDocument.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/updatedocument/SyncUpdateDocument.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservicesettings/getdocument/SyncGetDocument.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservice/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservice/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservice/create/SyncCreateSetEndpoint.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservice/recommend/AsyncRecommend.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservice/recommend/SyncRecommend.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservicesettings/recommend/SyncRecommend.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/create/SyncCreateSetEndpoint.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/createschema/AsyncCreateSchema.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/createschema/AsyncCreateSchemaLRO.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/createschema/SyncCreateSchema.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/createschema/SyncCreateSchemaDatastorenameSchemaString.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/createschema/SyncCreateSchemaStringSchemaString.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/deleteschema/AsyncDeleteSchema.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/deleteschema/AsyncDeleteSchemaLRO.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/deleteschema/SyncDeleteSchema.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/deleteschema/SyncDeleteSchemaSchemaname.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/deleteschema/SyncDeleteSchemaString.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/getschema/AsyncGetSchema.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/getschema/SyncGetSchema.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/getschema/SyncGetSchemaSchemaname.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/getschema/SyncGetSchemaString.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/listschemas/AsyncListSchemas.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/listschemas/AsyncListSchemasPaged.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/listschemas/SyncListSchemas.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/listschemas/SyncListSchemasDatastorename.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/listschemas/SyncListSchemasString.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/updateschema/AsyncUpdateSchema.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/updateschema/AsyncUpdateSchemaLRO.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/updateschema/SyncUpdateSchema.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservicesettings/getschema/SyncGetSchema.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/create/SyncCreateSetEndpoint.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/search/AsyncSearch.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/search/AsyncSearchPaged.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/search/SyncSearch.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservicesettings/search/SyncSearch.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/create/SyncCreateSetEndpoint.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/recrawluris/AsyncRecrawlUris.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/recrawluris/AsyncRecrawlUrisLRO.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/recrawluris/SyncRecrawlUris.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservicesettings/recrawluris/SyncRecrawlUris.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/completionservicestubsettings/completequery/SyncCompleteQuery.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/conversationalsearchservicestubsettings/converseconversation/SyncConverseConversation.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/documentservicestubsettings/getdocument/SyncGetDocument.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/recommendationservicestubsettings/recommend/SyncRecommend.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/schemaservicestubsettings/getschema/SyncGetSchema.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/searchservicestubsettings/search/SyncSearch.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/sitesearchengineservicestubsettings/recrawluris/SyncRecrawlUris.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/usereventservicestubsettings/writeuserevent/SyncWriteUserEvent.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/collectuserevent/AsyncCollectUserEvent.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/collectuserevent/SyncCollectUserEvent.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/create/SyncCreateSetEndpoint.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/importuserevents/AsyncImportUserEvents.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/importuserevents/AsyncImportUserEventsLRO.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/importuserevents/SyncImportUserEvents.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/purgeuserevents/AsyncPurgeUserEvents.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/purgeuserevents/AsyncPurgeUserEventsLRO.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/purgeuserevents/SyncPurgeUserEvents.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/writeuserevent/AsyncWriteUserEvent.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/writeuserevent/SyncWriteUserEvent.java create mode 100644 java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservicesettings/writeuserevent/SyncWriteUserEvent.java diff --git a/java-discoveryengine/README.md b/java-discoveryengine/README.md index 6691cf190fae..3344c76764be 100644 --- a/java-discoveryengine/README.md +++ b/java-discoveryengine/README.md @@ -23,7 +23,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.23.0 + 26.25.0 pom import @@ -201,7 +201,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html [stability-image]: https://img.shields.io/badge/stability-preview-yellow [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-discoveryengine.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-discoveryengine/0.20.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-discoveryengine/0.24.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/java-discoveryengine/google-cloud-discoveryengine-bom/pom.xml b/java-discoveryengine/google-cloud-discoveryengine-bom/pom.xml index 17a0ce7b7dfe..94d3a4c41211 100644 --- a/java-discoveryengine/google-cloud-discoveryengine-bom/pom.xml +++ b/java-discoveryengine/google-cloud-discoveryengine-bom/pom.xml @@ -39,6 +39,11 @@ grpc-google-cloud-discoveryengine-v1 0.24.0 + + com.google.api.grpc + grpc-google-cloud-discoveryengine-v1alpha + 0.24.0 + com.google.api.grpc proto-google-cloud-discoveryengine-v1beta @@ -49,6 +54,11 @@ proto-google-cloud-discoveryengine-v1 0.24.0 + + com.google.api.grpc + proto-google-cloud-discoveryengine-v1alpha + 0.24.0 + diff --git a/java-discoveryengine/google-cloud-discoveryengine/pom.xml b/java-discoveryengine/google-cloud-discoveryengine/pom.xml index d3245eb95679..e61e6831f7e2 100644 --- a/java-discoveryengine/google-cloud-discoveryengine/pom.xml +++ b/java-discoveryengine/google-cloud-discoveryengine/pom.xml @@ -41,6 +41,10 @@ proto-google-common-protos + + com.google.api.grpc + proto-google-cloud-discoveryengine-v1alpha + com.google.api.grpc proto-google-cloud-discoveryengine-v1 @@ -69,6 +73,11 @@ com.google.api.grpc grpc-google-common-protos + + com.google.api.grpc + grpc-google-cloud-discoveryengine-v1alpha + test + com.google.api.grpc grpc-google-cloud-discoveryengine-v1 diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceClient.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceClient.java new file mode 100644 index 000000000000..0c20f2a232ab --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceClient.java @@ -0,0 +1,281 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.discoveryengine.v1alpha.stub.CompletionServiceStub; +import com.google.cloud.discoveryengine.v1alpha.stub.CompletionServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for Auto-Completion. + * + *

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

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+ *   CompleteQueryRequest request =
+ *       CompleteQueryRequest.newBuilder()
+ *           .setDataStore(
+ *               DataStoreName.ofProjectLocationDataStoreName(
+ *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+ *                   .toString())
+ *           .setQuery("query107944136")
+ *           .setQueryModel("queryModel-184930495")
+ *           .setUserPseudoId("userPseudoId-1155274652")
+ *           .setIncludeTailSuggestions(true)
+ *           .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 and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * 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 and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * CompletionServiceSettings completionServiceSettings =
+ *     CompletionServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * CompletionServiceClient completionServiceClient =
+ *     CompletionServiceClient.create(completionServiceSettings);
+ * }
+ * + *

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

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * CompletionServiceSettings completionServiceSettings =
+ *     CompletionServiceSettings.newHttpJsonBuilder().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; + + /** 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(); + } + + protected CompletionServiceClient(CompletionServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final CompletionServiceSettings getSettings() { + return settings; + } + + public CompletionServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Completes the specified user input with keyword suggestions. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+   *   CompleteQueryRequest request =
+   *       CompleteQueryRequest.newBuilder()
+   *           .setDataStore(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .setQuery("query107944136")
+   *           .setQueryModel("queryModel-184930495")
+   *           .setUserPseudoId("userPseudoId-1155274652")
+   *           .setIncludeTailSuggestions(true)
+   *           .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 user input with keyword suggestions. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+   *   CompleteQueryRequest request =
+   *       CompleteQueryRequest.newBuilder()
+   *           .setDataStore(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .setQuery("query107944136")
+   *           .setQueryModel("queryModel-184930495")
+   *           .setUserPseudoId("userPseudoId-1155274652")
+   *           .setIncludeTailSuggestions(true)
+   *           .build();
+   *   ApiFuture future =
+   *       completionServiceClient.completeQueryCallable().futureCall(request);
+   *   // Do something.
+   *   CompleteQueryResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable completeQueryCallable() { + return stub.completeQueryCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceSettings.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceSettings.java new file mode 100644 index 000000000000..114edc76e496 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceSettings.java @@ -0,0 +1,208 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.discoveryengine.v1alpha.stub.CompletionServiceStubSettings; +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 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 and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * 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(); + } + + 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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CompletionServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return CompletionServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + 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 gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected 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()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(CompletionServiceStubSettings.newHttpJsonBuilder()); + } + + 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(); + } + + @Override + public CompletionServiceSettings build() throws IOException { + return new CompletionServiceSettings(this); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceClient.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceClient.java new file mode 100644 index 000000000000..275691b6c8e6 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceClient.java @@ -0,0 +1,1193 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +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.discoveryengine.v1alpha.stub.ConversationalSearchServiceStub; +import com.google.cloud.discoveryengine.v1alpha.stub.ConversationalSearchServiceStubSettings; +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 conversational search. + * + *

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

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+ *     ConversationalSearchServiceClient.create()) {
+ *   ConversationName name =
+ *       ConversationName.ofProjectLocationDataStoreConversationName(
+ *           "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]");
+ *   TextInput query = TextInput.newBuilder().build();
+ *   ConverseConversationResponse response =
+ *       conversationalSearchServiceClient.converseConversation(name, query);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the ConversationalSearchServiceClient 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 + * ConversationalSearchServiceSettings to create(). For example: + * + *

To customize credentials: + * + *

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

To customize the endpoint: + * + *

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

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

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   ConversationName name =
+   *       ConversationName.ofProjectLocationDataStoreConversationName(
+   *           "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]");
+   *   TextInput query = TextInput.newBuilder().build();
+   *   ConverseConversationResponse response =
+   *       conversationalSearchServiceClient.converseConversation(name, query);
+   * }
+   * }
+ * + * @param name Required. The resource name of the Conversation to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. + * Use + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-` + * to activate auto session mode, which automatically creates a new conversation inside a + * ConverseConversation session. + * @param query Required. Current user input. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ConverseConversationResponse converseConversation( + ConversationName name, TextInput query) { + ConverseConversationRequest request = + ConverseConversationRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setQuery(query) + .build(); + return converseConversation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Converses a conversation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   String name =
+   *       ConversationName.ofProjectLocationDataStoreConversationName(
+   *               "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]")
+   *           .toString();
+   *   TextInput query = TextInput.newBuilder().build();
+   *   ConverseConversationResponse response =
+   *       conversationalSearchServiceClient.converseConversation(name, query);
+   * }
+   * }
+ * + * @param name Required. The resource name of the Conversation to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. + * Use + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-` + * to activate auto session mode, which automatically creates a new conversation inside a + * ConverseConversation session. + * @param query Required. Current user input. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ConverseConversationResponse converseConversation(String name, TextInput query) { + ConverseConversationRequest request = + ConverseConversationRequest.newBuilder().setName(name).setQuery(query).build(); + return converseConversation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Converses a conversation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   ConverseConversationRequest request =
+   *       ConverseConversationRequest.newBuilder()
+   *           .setName(
+   *               ConversationName.ofProjectLocationDataStoreConversationName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]")
+   *                   .toString())
+   *           .setQuery(TextInput.newBuilder().build())
+   *           .setServingConfig(
+   *               ServingConfigName.ofProjectLocationDataStoreServingConfigName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .setConversation(Conversation.newBuilder().build())
+   *           .setSafeSearch(true)
+   *           .putAllUserLabels(new HashMap())
+   *           .setSummarySpec(SearchRequest.ContentSearchSpec.SummarySpec.newBuilder().build())
+   *           .build();
+   *   ConverseConversationResponse response =
+   *       conversationalSearchServiceClient.converseConversation(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 ConverseConversationResponse converseConversation( + ConverseConversationRequest request) { + return converseConversationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Converses a conversation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   ConverseConversationRequest request =
+   *       ConverseConversationRequest.newBuilder()
+   *           .setName(
+   *               ConversationName.ofProjectLocationDataStoreConversationName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]")
+   *                   .toString())
+   *           .setQuery(TextInput.newBuilder().build())
+   *           .setServingConfig(
+   *               ServingConfigName.ofProjectLocationDataStoreServingConfigName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .setConversation(Conversation.newBuilder().build())
+   *           .setSafeSearch(true)
+   *           .putAllUserLabels(new HashMap())
+   *           .setSummarySpec(SearchRequest.ContentSearchSpec.SummarySpec.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       conversationalSearchServiceClient.converseConversationCallable().futureCall(request);
+   *   // Do something.
+   *   ConverseConversationResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + converseConversationCallable() { + return stub.converseConversationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Conversation. + * + *

If the [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to create already + * exists, an ALREADY_EXISTS error is returned. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   DataStoreName parent =
+   *       DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]");
+   *   Conversation conversation = Conversation.newBuilder().build();
+   *   Conversation response =
+   *       conversationalSearchServiceClient.createConversation(parent, conversation);
+   * }
+   * }
+ * + * @param parent Required. Full resource name of parent data store. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * @param conversation Required. The conversation to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Conversation createConversation(DataStoreName parent, Conversation conversation) { + CreateConversationRequest request = + CreateConversationRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setConversation(conversation) + .build(); + return createConversation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Conversation. + * + *

If the [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to create already + * exists, an ALREADY_EXISTS error is returned. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   String parent =
+   *       DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *           .toString();
+   *   Conversation conversation = Conversation.newBuilder().build();
+   *   Conversation response =
+   *       conversationalSearchServiceClient.createConversation(parent, conversation);
+   * }
+   * }
+ * + * @param parent Required. Full resource name of parent data store. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * @param conversation Required. The conversation to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Conversation createConversation(String parent, Conversation conversation) { + CreateConversationRequest request = + CreateConversationRequest.newBuilder() + .setParent(parent) + .setConversation(conversation) + .build(); + return createConversation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Conversation. + * + *

If the [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to create already + * exists, an ALREADY_EXISTS error is returned. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   CreateConversationRequest request =
+   *       CreateConversationRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .setConversation(Conversation.newBuilder().build())
+   *           .build();
+   *   Conversation response = conversationalSearchServiceClient.createConversation(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 Conversation createConversation(CreateConversationRequest request) { + return createConversationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Conversation. + * + *

If the [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to create already + * exists, an ALREADY_EXISTS error is returned. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   CreateConversationRequest request =
+   *       CreateConversationRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .setConversation(Conversation.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       conversationalSearchServiceClient.createConversationCallable().futureCall(request);
+   *   // Do something.
+   *   Conversation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createConversationCallable() { + return stub.createConversationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Conversation. + * + *

If the [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to delete does not + * exist, a NOT_FOUND error is returned. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   ConversationName name =
+   *       ConversationName.ofProjectLocationDataStoreConversationName(
+   *           "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]");
+   *   conversationalSearchServiceClient.deleteConversation(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the Conversation to delete. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteConversation(ConversationName name) { + DeleteConversationRequest request = + DeleteConversationRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteConversation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Conversation. + * + *

If the [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to delete does not + * exist, a NOT_FOUND error is returned. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   String name =
+   *       ConversationName.ofProjectLocationDataStoreConversationName(
+   *               "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]")
+   *           .toString();
+   *   conversationalSearchServiceClient.deleteConversation(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the Conversation to delete. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteConversation(String name) { + DeleteConversationRequest request = + DeleteConversationRequest.newBuilder().setName(name).build(); + deleteConversation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Conversation. + * + *

If the [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to delete does not + * exist, a NOT_FOUND error is returned. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   DeleteConversationRequest request =
+   *       DeleteConversationRequest.newBuilder()
+   *           .setName(
+   *               ConversationName.ofProjectLocationDataStoreConversationName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]")
+   *                   .toString())
+   *           .build();
+   *   conversationalSearchServiceClient.deleteConversation(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 deleteConversation(DeleteConversationRequest request) { + deleteConversationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a Conversation. + * + *

If the [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to delete does not + * exist, a NOT_FOUND error is returned. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   DeleteConversationRequest request =
+   *       DeleteConversationRequest.newBuilder()
+   *           .setName(
+   *               ConversationName.ofProjectLocationDataStoreConversationName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       conversationalSearchServiceClient.deleteConversationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteConversationCallable() { + return stub.deleteConversationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a Conversation. + * + *

[Conversation][google.cloud.discoveryengine.v1alpha.Conversation] action type cannot be + * changed. If the [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to update + * does not exist, a NOT_FOUND error is returned. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   Conversation conversation = Conversation.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Conversation response =
+   *       conversationalSearchServiceClient.updateConversation(conversation, updateMask);
+   * }
+   * }
+ * + * @param conversation Required. The Conversation to update. + * @param updateMask Indicates which fields in the provided + * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to update. The following + * are NOT supported: + *
    + *
  • [conversation.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 Conversation updateConversation(Conversation conversation, FieldMask updateMask) { + UpdateConversationRequest request = + UpdateConversationRequest.newBuilder() + .setConversation(conversation) + .setUpdateMask(updateMask) + .build(); + return updateConversation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a Conversation. + * + *

[Conversation][google.cloud.discoveryengine.v1alpha.Conversation] action type cannot be + * changed. If the [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to update + * does not exist, a NOT_FOUND error is returned. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   UpdateConversationRequest request =
+   *       UpdateConversationRequest.newBuilder()
+   *           .setConversation(Conversation.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Conversation response = conversationalSearchServiceClient.updateConversation(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 Conversation updateConversation(UpdateConversationRequest request) { + return updateConversationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a Conversation. + * + *

[Conversation][google.cloud.discoveryengine.v1alpha.Conversation] action type cannot be + * changed. If the [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to update + * does not exist, a NOT_FOUND error is returned. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   UpdateConversationRequest request =
+   *       UpdateConversationRequest.newBuilder()
+   *           .setConversation(Conversation.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       conversationalSearchServiceClient.updateConversationCallable().futureCall(request);
+   *   // Do something.
+   *   Conversation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateConversationCallable() { + return stub.updateConversationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a Conversation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   ConversationName name =
+   *       ConversationName.ofProjectLocationDataStoreConversationName(
+   *           "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]");
+   *   Conversation response = conversationalSearchServiceClient.getConversation(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the Conversation to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Conversation getConversation(ConversationName name) { + GetConversationRequest request = + GetConversationRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getConversation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a Conversation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   String name =
+   *       ConversationName.ofProjectLocationDataStoreConversationName(
+   *               "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]")
+   *           .toString();
+   *   Conversation response = conversationalSearchServiceClient.getConversation(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the Conversation to get. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Conversation getConversation(String name) { + GetConversationRequest request = GetConversationRequest.newBuilder().setName(name).build(); + return getConversation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a Conversation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   GetConversationRequest request =
+   *       GetConversationRequest.newBuilder()
+   *           .setName(
+   *               ConversationName.ofProjectLocationDataStoreConversationName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]")
+   *                   .toString())
+   *           .build();
+   *   Conversation response = conversationalSearchServiceClient.getConversation(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 Conversation getConversation(GetConversationRequest request) { + return getConversationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a Conversation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   GetConversationRequest request =
+   *       GetConversationRequest.newBuilder()
+   *           .setName(
+   *               ConversationName.ofProjectLocationDataStoreConversationName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       conversationalSearchServiceClient.getConversationCallable().futureCall(request);
+   *   // Do something.
+   *   Conversation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getConversationCallable() { + return stub.getConversationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all Conversations by their parent + * [DataStore][google.cloud.discoveryengine.v1alpha.DataStore]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   DataStoreName parent =
+   *       DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]");
+   *   for (Conversation element :
+   *       conversationalSearchServiceClient.listConversations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The data store resource name. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListConversationsPagedResponse listConversations(DataStoreName parent) { + ListConversationsRequest request = + ListConversationsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listConversations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all Conversations by their parent + * [DataStore][google.cloud.discoveryengine.v1alpha.DataStore]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   String parent =
+   *       DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *           .toString();
+   *   for (Conversation element :
+   *       conversationalSearchServiceClient.listConversations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The data store resource name. Format: + * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListConversationsPagedResponse listConversations(String parent) { + ListConversationsRequest request = + ListConversationsRequest.newBuilder().setParent(parent).build(); + return listConversations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all Conversations by their parent + * [DataStore][google.cloud.discoveryengine.v1alpha.DataStore]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   ListConversationsRequest request =
+   *       ListConversationsRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Conversation element :
+   *       conversationalSearchServiceClient.listConversations(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 ListConversationsPagedResponse listConversations(ListConversationsRequest request) { + return listConversationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all Conversations by their parent + * [DataStore][google.cloud.discoveryengine.v1alpha.DataStore]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   ListConversationsRequest request =
+   *       ListConversationsRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       conversationalSearchServiceClient.listConversationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Conversation element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listConversationsPagedCallable() { + return stub.listConversationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all Conversations by their parent + * [DataStore][google.cloud.discoveryengine.v1alpha.DataStore]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+   *     ConversationalSearchServiceClient.create()) {
+   *   ListConversationsRequest request =
+   *       ListConversationsRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListConversationsResponse response =
+   *         conversationalSearchServiceClient.listConversationsCallable().call(request);
+   *     for (Conversation element : response.getConversationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listConversationsCallable() { + return stub.listConversationsCallable(); + } + + @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 ListConversationsPagedResponse + extends AbstractPagedListResponse< + ListConversationsRequest, + ListConversationsResponse, + Conversation, + ListConversationsPage, + ListConversationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListConversationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListConversationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListConversationsPagedResponse(ListConversationsPage page) { + super(page, ListConversationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListConversationsPage + extends AbstractPage< + ListConversationsRequest, + ListConversationsResponse, + Conversation, + ListConversationsPage> { + + private ListConversationsPage( + PageContext context, + ListConversationsResponse response) { + super(context, response); + } + + private static ListConversationsPage createEmptyPage() { + return new ListConversationsPage(null, null); + } + + @Override + protected ListConversationsPage createPage( + PageContext context, + ListConversationsResponse response) { + return new ListConversationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListConversationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListConversationsRequest, + ListConversationsResponse, + Conversation, + ListConversationsPage, + ListConversationsFixedSizeCollection> { + + private ListConversationsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListConversationsFixedSizeCollection createEmptyCollection() { + return new ListConversationsFixedSizeCollection(null, 0); + } + + @Override + protected ListConversationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListConversationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceSettings.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceSettings.java new file mode 100644 index 000000000000..182a146b889c --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceSettings.java @@ -0,0 +1,279 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import static com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient.ListConversationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.discoveryengine.v1alpha.stub.ConversationalSearchServiceStubSettings; +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 ConversationalSearchServiceClient}. + * + *

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

    + *
  • The default service address (discoveryengine.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 converseConversation to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ConversationalSearchServiceSettings.Builder conversationalSearchServiceSettingsBuilder =
+ *     ConversationalSearchServiceSettings.newBuilder();
+ * conversationalSearchServiceSettingsBuilder
+ *     .converseConversationSettings()
+ *     .setRetrySettings(
+ *         conversationalSearchServiceSettingsBuilder
+ *             .converseConversationSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ConversationalSearchServiceSettings conversationalSearchServiceSettings =
+ *     conversationalSearchServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ConversationalSearchServiceSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to converseConversation. */ + public UnaryCallSettings + converseConversationSettings() { + return ((ConversationalSearchServiceStubSettings) getStubSettings()) + .converseConversationSettings(); + } + + /** Returns the object with the settings used for calls to createConversation. */ + public UnaryCallSettings createConversationSettings() { + return ((ConversationalSearchServiceStubSettings) getStubSettings()) + .createConversationSettings(); + } + + /** Returns the object with the settings used for calls to deleteConversation. */ + public UnaryCallSettings deleteConversationSettings() { + return ((ConversationalSearchServiceStubSettings) getStubSettings()) + .deleteConversationSettings(); + } + + /** Returns the object with the settings used for calls to updateConversation. */ + public UnaryCallSettings updateConversationSettings() { + return ((ConversationalSearchServiceStubSettings) getStubSettings()) + .updateConversationSettings(); + } + + /** Returns the object with the settings used for calls to getConversation. */ + public UnaryCallSettings getConversationSettings() { + return ((ConversationalSearchServiceStubSettings) getStubSettings()).getConversationSettings(); + } + + /** Returns the object with the settings used for calls to listConversations. */ + public PagedCallSettings< + ListConversationsRequest, ListConversationsResponse, ListConversationsPagedResponse> + listConversationsSettings() { + return ((ConversationalSearchServiceStubSettings) getStubSettings()) + .listConversationsSettings(); + } + + public static final ConversationalSearchServiceSettings create( + ConversationalSearchServiceStubSettings stub) throws IOException { + return new ConversationalSearchServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ConversationalSearchServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ConversationalSearchServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ConversationalSearchServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ConversationalSearchServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ConversationalSearchServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return ConversationalSearchServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ConversationalSearchServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ConversationalSearchServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ConversationalSearchServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ConversationalSearchServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ConversationalSearchServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(ConversationalSearchServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ConversationalSearchServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ConversationalSearchServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(ConversationalSearchServiceStubSettings.newHttpJsonBuilder()); + } + + public ConversationalSearchServiceStubSettings.Builder getStubSettingsBuilder() { + return ((ConversationalSearchServiceStubSettings.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 converseConversation. */ + public UnaryCallSettings.Builder + converseConversationSettings() { + return getStubSettingsBuilder().converseConversationSettings(); + } + + /** Returns the builder for the settings used for calls to createConversation. */ + public UnaryCallSettings.Builder + createConversationSettings() { + return getStubSettingsBuilder().createConversationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteConversation. */ + public UnaryCallSettings.Builder + deleteConversationSettings() { + return getStubSettingsBuilder().deleteConversationSettings(); + } + + /** Returns the builder for the settings used for calls to updateConversation. */ + public UnaryCallSettings.Builder + updateConversationSettings() { + return getStubSettingsBuilder().updateConversationSettings(); + } + + /** Returns the builder for the settings used for calls to getConversation. */ + public UnaryCallSettings.Builder + getConversationSettings() { + return getStubSettingsBuilder().getConversationSettings(); + } + + /** Returns the builder for the settings used for calls to listConversations. */ + public PagedCallSettings.Builder< + ListConversationsRequest, ListConversationsResponse, ListConversationsPagedResponse> + listConversationsSettings() { + return getStubSettingsBuilder().listConversationsSettings(); + } + + @Override + public ConversationalSearchServiceSettings build() throws IOException { + return new ConversationalSearchServiceSettings(this); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceClient.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceClient.java new file mode 100644 index 000000000000..2a5837e9c27c --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceClient.java @@ -0,0 +1,1257 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.discoveryengine.v1alpha.stub.DocumentServiceStub; +import com.google.cloud.discoveryengine.v1alpha.stub.DocumentServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +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 + * [Document][google.cloud.discoveryengine.v1alpha.Document] 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 and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ *   DocumentName name =
+ *       DocumentName.ofProjectLocationDataStoreBranchDocumentName(
+ *           "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]");
+ *   Document response = documentServiceClient.getDocument(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the DocumentServiceClient 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 DocumentServiceSettings to + * create(). For example: + * + *

To customize credentials: + * + *

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

To customize the endpoint: + * + *

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

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

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class DocumentServiceClient implements BackgroundResource { + private final DocumentServiceSettings settings; + private final DocumentServiceStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of DocumentServiceClient with default settings. */ + public static final DocumentServiceClient create() throws IOException { + return create(DocumentServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of DocumentServiceClient, 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 DocumentServiceClient create(DocumentServiceSettings settings) + throws IOException { + return new DocumentServiceClient(settings); + } + + /** + * Constructs an instance of DocumentServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(DocumentServiceSettings). + */ + public static final DocumentServiceClient create(DocumentServiceStub stub) { + return new DocumentServiceClient(stub); + } + + /** + * Constructs an instance of DocumentServiceClient, 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 DocumentServiceClient(DocumentServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((DocumentServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected DocumentServiceClient(DocumentServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final DocumentServiceSettings getSettings() { + return settings; + } + + public DocumentServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [Document][google.cloud.discoveryengine.v1alpha.Document]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   DocumentName name =
+   *       DocumentName.ofProjectLocationDataStoreBranchDocumentName(
+   *           "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]");
+   *   Document response = documentServiceClient.getDocument(name);
+   * }
+   * }
+ * + * @param name Required. Full resource name of + * [Document][google.cloud.discoveryengine.v1alpha.Document], such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. + *

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   String name =
+   *       DocumentName.ofProjectLocationDataStoreBranchDocumentName(
+   *               "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]")
+   *           .toString();
+   *   Document response = documentServiceClient.getDocument(name);
+   * }
+   * }
+ * + * @param name Required. Full resource name of + * [Document][google.cloud.discoveryengine.v1alpha.Document], such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. + *

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   GetDocumentRequest request =
+   *       GetDocumentRequest.newBuilder()
+   *           .setName(
+   *               DocumentName.ofProjectLocationDataStoreBranchDocumentName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]")
+   *                   .toString())
+   *           .build();
+   *   Document response = documentServiceClient.getDocument(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 Document getDocument(GetDocumentRequest request) { + return getDocumentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [Document][google.cloud.discoveryengine.v1alpha.Document]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   GetDocumentRequest request =
+   *       GetDocumentRequest.newBuilder()
+   *           .setName(
+   *               DocumentName.ofProjectLocationDataStoreBranchDocumentName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = documentServiceClient.getDocumentCallable().futureCall(request);
+   *   // Do something.
+   *   Document response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getDocumentCallable() { + return stub.getDocumentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Document][google.cloud.discoveryengine.v1alpha.Document]s. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   BranchName parent =
+   *       BranchName.ofProjectLocationDataStoreBranchName(
+   *           "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]");
+   *   for (Document element : documentServiceClient.listDocuments(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent branch resource name, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + * Use `default_branch` as the branch ID, to list documents under the default branch. + *

If the caller does not have permission to list + * [Document][google.cloud.discoveryengine.v1alpha.Document]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 ListDocumentsPagedResponse listDocuments(BranchName parent) { + ListDocumentsRequest request = + ListDocumentsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listDocuments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Document][google.cloud.discoveryengine.v1alpha.Document]s. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   String parent =
+   *       BranchName.ofProjectLocationDataStoreBranchName(
+   *               "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]")
+   *           .toString();
+   *   for (Document element : documentServiceClient.listDocuments(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent branch resource name, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + * Use `default_branch` as the branch ID, to list documents under the default branch. + *

If the caller does not have permission to list + * [Document][google.cloud.discoveryengine.v1alpha.Document]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 ListDocumentsPagedResponse listDocuments(String parent) { + ListDocumentsRequest request = ListDocumentsRequest.newBuilder().setParent(parent).build(); + return listDocuments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Document][google.cloud.discoveryengine.v1alpha.Document]s. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   ListDocumentsRequest request =
+   *       ListDocumentsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.ofProjectLocationDataStoreBranchName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Document element : documentServiceClient.listDocuments(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 ListDocumentsPagedResponse listDocuments(ListDocumentsRequest request) { + return listDocumentsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Document][google.cloud.discoveryengine.v1alpha.Document]s. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   ListDocumentsRequest request =
+   *       ListDocumentsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.ofProjectLocationDataStoreBranchName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       documentServiceClient.listDocumentsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Document element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listDocumentsPagedCallable() { + return stub.listDocumentsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Document][google.cloud.discoveryengine.v1alpha.Document]s. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   ListDocumentsRequest request =
+   *       ListDocumentsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.ofProjectLocationDataStoreBranchName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListDocumentsResponse response =
+   *         documentServiceClient.listDocumentsCallable().call(request);
+   *     for (Document element : response.getDocumentsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listDocumentsCallable() { + return stub.listDocumentsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a [Document][google.cloud.discoveryengine.v1alpha.Document]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   BranchName parent =
+   *       BranchName.ofProjectLocationDataStoreBranchName(
+   *           "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]");
+   *   Document document = Document.newBuilder().build();
+   *   String documentId = "documentId-814940266";
+   *   Document response = documentServiceClient.createDocument(parent, document, documentId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource name, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + * @param document Required. The [Document][google.cloud.discoveryengine.v1alpha.Document] to + * create. + * @param documentId Required. The ID to use for the + * [Document][google.cloud.discoveryengine.v1alpha.Document], which will become the final + * component of the [Document.name][google.cloud.discoveryengine.v1alpha.Document.name]. + *

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

This field must be unique among all + * [Document][google.cloud.discoveryengine.v1alpha.Document]s with the same + * [parent][google.cloud.discoveryengine.v1alpha.CreateDocumentRequest.parent]. Otherwise, an + * `ALREADY_EXISTS` error is returned. + *

This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with + * a length limit of 63 characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Document createDocument(BranchName parent, Document document, String documentId) { + CreateDocumentRequest request = + CreateDocumentRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setDocument(document) + .setDocumentId(documentId) + .build(); + return createDocument(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a [Document][google.cloud.discoveryengine.v1alpha.Document]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   String parent =
+   *       BranchName.ofProjectLocationDataStoreBranchName(
+   *               "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]")
+   *           .toString();
+   *   Document document = Document.newBuilder().build();
+   *   String documentId = "documentId-814940266";
+   *   Document response = documentServiceClient.createDocument(parent, document, documentId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource name, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + * @param document Required. The [Document][google.cloud.discoveryengine.v1alpha.Document] to + * create. + * @param documentId Required. The ID to use for the + * [Document][google.cloud.discoveryengine.v1alpha.Document], which will become the final + * component of the [Document.name][google.cloud.discoveryengine.v1alpha.Document.name]. + *

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

This field must be unique among all + * [Document][google.cloud.discoveryengine.v1alpha.Document]s with the same + * [parent][google.cloud.discoveryengine.v1alpha.CreateDocumentRequest.parent]. Otherwise, an + * `ALREADY_EXISTS` error is returned. + *

This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with + * a length limit of 63 characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Document createDocument(String parent, Document document, String documentId) { + CreateDocumentRequest request = + CreateDocumentRequest.newBuilder() + .setParent(parent) + .setDocument(document) + .setDocumentId(documentId) + .build(); + return createDocument(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a [Document][google.cloud.discoveryengine.v1alpha.Document]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   CreateDocumentRequest request =
+   *       CreateDocumentRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.ofProjectLocationDataStoreBranchName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]")
+   *                   .toString())
+   *           .setDocument(Document.newBuilder().build())
+   *           .setDocumentId("documentId-814940266")
+   *           .build();
+   *   Document response = documentServiceClient.createDocument(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 Document createDocument(CreateDocumentRequest request) { + return createDocumentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a [Document][google.cloud.discoveryengine.v1alpha.Document]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   CreateDocumentRequest request =
+   *       CreateDocumentRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.ofProjectLocationDataStoreBranchName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]")
+   *                   .toString())
+   *           .setDocument(Document.newBuilder().build())
+   *           .setDocumentId("documentId-814940266")
+   *           .build();
+   *   ApiFuture future =
+   *       documentServiceClient.createDocumentCallable().futureCall(request);
+   *   // Do something.
+   *   Document response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createDocumentCallable() { + return stub.createDocumentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a [Document][google.cloud.discoveryengine.v1alpha.Document]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   UpdateDocumentRequest request =
+   *       UpdateDocumentRequest.newBuilder()
+   *           .setDocument(Document.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   Document response = documentServiceClient.updateDocument(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 Document updateDocument(UpdateDocumentRequest request) { + return updateDocumentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a [Document][google.cloud.discoveryengine.v1alpha.Document]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   UpdateDocumentRequest request =
+   *       UpdateDocumentRequest.newBuilder()
+   *           .setDocument(Document.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future =
+   *       documentServiceClient.updateDocumentCallable().futureCall(request);
+   *   // Do something.
+   *   Document response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateDocumentCallable() { + return stub.updateDocumentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a [Document][google.cloud.discoveryengine.v1alpha.Document]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   DocumentName name =
+   *       DocumentName.ofProjectLocationDataStoreBranchDocumentName(
+   *           "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]");
+   *   documentServiceClient.deleteDocument(name);
+   * }
+   * }
+ * + * @param name Required. Full resource name of + * [Document][google.cloud.discoveryengine.v1alpha.Document], such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. + *

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

If the [Document][google.cloud.discoveryengine.v1alpha.Document] to delete does not + * exist, a `NOT_FOUND` error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDocument(DocumentName name) { + DeleteDocumentRequest request = + DeleteDocumentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteDocument(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a [Document][google.cloud.discoveryengine.v1alpha.Document]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   String name =
+   *       DocumentName.ofProjectLocationDataStoreBranchDocumentName(
+   *               "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]")
+   *           .toString();
+   *   documentServiceClient.deleteDocument(name);
+   * }
+   * }
+ * + * @param name Required. Full resource name of + * [Document][google.cloud.discoveryengine.v1alpha.Document], such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. + *

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

If the [Document][google.cloud.discoveryengine.v1alpha.Document] to delete does not + * exist, a `NOT_FOUND` error is returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDocument(String name) { + DeleteDocumentRequest request = DeleteDocumentRequest.newBuilder().setName(name).build(); + deleteDocument(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a [Document][google.cloud.discoveryengine.v1alpha.Document]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   DeleteDocumentRequest request =
+   *       DeleteDocumentRequest.newBuilder()
+   *           .setName(
+   *               DocumentName.ofProjectLocationDataStoreBranchDocumentName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]")
+   *                   .toString())
+   *           .build();
+   *   documentServiceClient.deleteDocument(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 deleteDocument(DeleteDocumentRequest request) { + deleteDocumentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a [Document][google.cloud.discoveryengine.v1alpha.Document]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   DeleteDocumentRequest request =
+   *       DeleteDocumentRequest.newBuilder()
+   *           .setName(
+   *               DocumentName.ofProjectLocationDataStoreBranchDocumentName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = documentServiceClient.deleteDocumentCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteDocumentCallable() { + return stub.deleteDocumentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Bulk import of multiple [Document][google.cloud.discoveryengine.v1alpha.Document]s. Request + * processing may be synchronous. Non-existing items will be created. + * + *

Note: It is possible for a subset of the + * [Document][google.cloud.discoveryengine.v1alpha.Document]s to be successfully updated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   ImportDocumentsRequest request =
+   *       ImportDocumentsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.ofProjectLocationDataStoreBranchName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]")
+   *                   .toString())
+   *           .setErrorConfig(ImportErrorConfig.newBuilder().build())
+   *           .setAutoGenerateIds(true)
+   *           .setIdField("idField1629396127")
+   *           .build();
+   *   ImportDocumentsResponse response = documentServiceClient.importDocumentsAsync(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 + importDocumentsAsync(ImportDocumentsRequest request) { + return importDocumentsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Bulk import of multiple [Document][google.cloud.discoveryengine.v1alpha.Document]s. Request + * processing may be synchronous. Non-existing items will be created. + * + *

Note: It is possible for a subset of the + * [Document][google.cloud.discoveryengine.v1alpha.Document]s to be successfully updated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   ImportDocumentsRequest request =
+   *       ImportDocumentsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.ofProjectLocationDataStoreBranchName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]")
+   *                   .toString())
+   *           .setErrorConfig(ImportErrorConfig.newBuilder().build())
+   *           .setAutoGenerateIds(true)
+   *           .setIdField("idField1629396127")
+   *           .build();
+   *   OperationFuture future =
+   *       documentServiceClient.importDocumentsOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ImportDocumentsResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + ImportDocumentsRequest, ImportDocumentsResponse, ImportDocumentsMetadata> + importDocumentsOperationCallable() { + return stub.importDocumentsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Bulk import of multiple [Document][google.cloud.discoveryengine.v1alpha.Document]s. Request + * processing may be synchronous. Non-existing items will be created. + * + *

Note: It is possible for a subset of the + * [Document][google.cloud.discoveryengine.v1alpha.Document]s to be successfully updated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   ImportDocumentsRequest request =
+   *       ImportDocumentsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.ofProjectLocationDataStoreBranchName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]")
+   *                   .toString())
+   *           .setErrorConfig(ImportErrorConfig.newBuilder().build())
+   *           .setAutoGenerateIds(true)
+   *           .setIdField("idField1629396127")
+   *           .build();
+   *   ApiFuture future =
+   *       documentServiceClient.importDocumentsCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable importDocumentsCallable() { + return stub.importDocumentsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes all selected [Document][google.cloud.discoveryengine.v1alpha.Document]s in + * a branch. + * + *

This process is asynchronous. Depending on the number of + * [Document][google.cloud.discoveryengine.v1alpha.Document]s to be deleted, this operation can + * take hours to complete. Before the delete operation completes, some + * [Document][google.cloud.discoveryengine.v1alpha.Document]s might still be returned by + * [DocumentService.GetDocument][google.cloud.discoveryengine.v1alpha.DocumentService.GetDocument] + * or + * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]. + * + *

To get a list of the [Document][google.cloud.discoveryengine.v1alpha.Document]s to be + * deleted, set + * [PurgeDocumentsRequest.force][google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest.force] + * to false. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   PurgeDocumentsRequest request =
+   *       PurgeDocumentsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.ofProjectLocationDataStoreBranchName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]")
+   *                   .toString())
+   *           .setFilter("filter-1274492040")
+   *           .setForce(true)
+   *           .build();
+   *   PurgeDocumentsResponse response = documentServiceClient.purgeDocumentsAsync(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 purgeDocumentsAsync( + PurgeDocumentsRequest request) { + return purgeDocumentsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes all selected [Document][google.cloud.discoveryengine.v1alpha.Document]s in + * a branch. + * + *

This process is asynchronous. Depending on the number of + * [Document][google.cloud.discoveryengine.v1alpha.Document]s to be deleted, this operation can + * take hours to complete. Before the delete operation completes, some + * [Document][google.cloud.discoveryengine.v1alpha.Document]s might still be returned by + * [DocumentService.GetDocument][google.cloud.discoveryengine.v1alpha.DocumentService.GetDocument] + * or + * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]. + * + *

To get a list of the [Document][google.cloud.discoveryengine.v1alpha.Document]s to be + * deleted, set + * [PurgeDocumentsRequest.force][google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest.force] + * to false. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   PurgeDocumentsRequest request =
+   *       PurgeDocumentsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.ofProjectLocationDataStoreBranchName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]")
+   *                   .toString())
+   *           .setFilter("filter-1274492040")
+   *           .setForce(true)
+   *           .build();
+   *   OperationFuture future =
+   *       documentServiceClient.purgeDocumentsOperationCallable().futureCall(request);
+   *   // Do something.
+   *   PurgeDocumentsResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + PurgeDocumentsRequest, PurgeDocumentsResponse, PurgeDocumentsMetadata> + purgeDocumentsOperationCallable() { + return stub.purgeDocumentsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes all selected [Document][google.cloud.discoveryengine.v1alpha.Document]s in + * a branch. + * + *

This process is asynchronous. Depending on the number of + * [Document][google.cloud.discoveryengine.v1alpha.Document]s to be deleted, this operation can + * take hours to complete. Before the delete operation completes, some + * [Document][google.cloud.discoveryengine.v1alpha.Document]s might still be returned by + * [DocumentService.GetDocument][google.cloud.discoveryengine.v1alpha.DocumentService.GetDocument] + * or + * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]. + * + *

To get a list of the [Document][google.cloud.discoveryengine.v1alpha.Document]s to be + * deleted, set + * [PurgeDocumentsRequest.force][google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest.force] + * to false. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+   *   PurgeDocumentsRequest request =
+   *       PurgeDocumentsRequest.newBuilder()
+   *           .setParent(
+   *               BranchName.ofProjectLocationDataStoreBranchName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]")
+   *                   .toString())
+   *           .setFilter("filter-1274492040")
+   *           .setForce(true)
+   *           .build();
+   *   ApiFuture future =
+   *       documentServiceClient.purgeDocumentsCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable purgeDocumentsCallable() { + return stub.purgeDocumentsCallable(); + } + + @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 ListDocumentsPagedResponse + extends AbstractPagedListResponse< + ListDocumentsRequest, + ListDocumentsResponse, + Document, + ListDocumentsPage, + ListDocumentsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListDocumentsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListDocumentsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListDocumentsPagedResponse(ListDocumentsPage page) { + super(page, ListDocumentsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListDocumentsPage + extends AbstractPage< + ListDocumentsRequest, ListDocumentsResponse, Document, ListDocumentsPage> { + + private ListDocumentsPage( + PageContext context, + ListDocumentsResponse response) { + super(context, response); + } + + private static ListDocumentsPage createEmptyPage() { + return new ListDocumentsPage(null, null); + } + + @Override + protected ListDocumentsPage createPage( + PageContext context, + ListDocumentsResponse response) { + return new ListDocumentsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListDocumentsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListDocumentsRequest, + ListDocumentsResponse, + Document, + ListDocumentsPage, + ListDocumentsFixedSizeCollection> { + + private ListDocumentsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListDocumentsFixedSizeCollection createEmptyCollection() { + return new ListDocumentsFixedSizeCollection(null, 0); + } + + @Override + protected ListDocumentsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListDocumentsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceSettings.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceSettings.java new file mode 100644 index 000000000000..335cbe253f7b --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceSettings.java @@ -0,0 +1,304 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import static com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient.ListDocumentsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.discoveryengine.v1alpha.stub.DocumentServiceStubSettings; +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 DocumentServiceClient}. + * + *

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

    + *
  • The default service address (discoveryengine.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 getDocument to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DocumentServiceSettings.Builder documentServiceSettingsBuilder =
+ *     DocumentServiceSettings.newBuilder();
+ * documentServiceSettingsBuilder
+ *     .getDocumentSettings()
+ *     .setRetrySettings(
+ *         documentServiceSettingsBuilder
+ *             .getDocumentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * DocumentServiceSettings documentServiceSettings = documentServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class DocumentServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to getDocument. */ + public UnaryCallSettings getDocumentSettings() { + return ((DocumentServiceStubSettings) getStubSettings()).getDocumentSettings(); + } + + /** Returns the object with the settings used for calls to listDocuments. */ + public PagedCallSettings + listDocumentsSettings() { + return ((DocumentServiceStubSettings) getStubSettings()).listDocumentsSettings(); + } + + /** Returns the object with the settings used for calls to createDocument. */ + public UnaryCallSettings createDocumentSettings() { + return ((DocumentServiceStubSettings) getStubSettings()).createDocumentSettings(); + } + + /** Returns the object with the settings used for calls to updateDocument. */ + public UnaryCallSettings updateDocumentSettings() { + return ((DocumentServiceStubSettings) getStubSettings()).updateDocumentSettings(); + } + + /** Returns the object with the settings used for calls to deleteDocument. */ + public UnaryCallSettings deleteDocumentSettings() { + return ((DocumentServiceStubSettings) getStubSettings()).deleteDocumentSettings(); + } + + /** Returns the object with the settings used for calls to importDocuments. */ + public UnaryCallSettings importDocumentsSettings() { + return ((DocumentServiceStubSettings) getStubSettings()).importDocumentsSettings(); + } + + /** Returns the object with the settings used for calls to importDocuments. */ + public OperationCallSettings< + ImportDocumentsRequest, ImportDocumentsResponse, ImportDocumentsMetadata> + importDocumentsOperationSettings() { + return ((DocumentServiceStubSettings) getStubSettings()).importDocumentsOperationSettings(); + } + + /** Returns the object with the settings used for calls to purgeDocuments. */ + public UnaryCallSettings purgeDocumentsSettings() { + return ((DocumentServiceStubSettings) getStubSettings()).purgeDocumentsSettings(); + } + + /** Returns the object with the settings used for calls to purgeDocuments. */ + public OperationCallSettings< + PurgeDocumentsRequest, PurgeDocumentsResponse, PurgeDocumentsMetadata> + purgeDocumentsOperationSettings() { + return ((DocumentServiceStubSettings) getStubSettings()).purgeDocumentsOperationSettings(); + } + + public static final DocumentServiceSettings create(DocumentServiceStubSettings stub) + throws IOException { + return new DocumentServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return DocumentServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return DocumentServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DocumentServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return DocumentServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return DocumentServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return DocumentServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return DocumentServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DocumentServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected DocumentServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for DocumentServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(DocumentServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(DocumentServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(DocumentServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(DocumentServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(DocumentServiceStubSettings.newHttpJsonBuilder()); + } + + public DocumentServiceStubSettings.Builder getStubSettingsBuilder() { + return ((DocumentServiceStubSettings.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 getDocument. */ + public UnaryCallSettings.Builder getDocumentSettings() { + return getStubSettingsBuilder().getDocumentSettings(); + } + + /** Returns the builder for the settings used for calls to listDocuments. */ + public PagedCallSettings.Builder< + ListDocumentsRequest, ListDocumentsResponse, ListDocumentsPagedResponse> + listDocumentsSettings() { + return getStubSettingsBuilder().listDocumentsSettings(); + } + + /** Returns the builder for the settings used for calls to createDocument. */ + public UnaryCallSettings.Builder createDocumentSettings() { + return getStubSettingsBuilder().createDocumentSettings(); + } + + /** Returns the builder for the settings used for calls to updateDocument. */ + public UnaryCallSettings.Builder updateDocumentSettings() { + return getStubSettingsBuilder().updateDocumentSettings(); + } + + /** Returns the builder for the settings used for calls to deleteDocument. */ + public UnaryCallSettings.Builder deleteDocumentSettings() { + return getStubSettingsBuilder().deleteDocumentSettings(); + } + + /** Returns the builder for the settings used for calls to importDocuments. */ + public UnaryCallSettings.Builder importDocumentsSettings() { + return getStubSettingsBuilder().importDocumentsSettings(); + } + + /** Returns the builder for the settings used for calls to importDocuments. */ + public OperationCallSettings.Builder< + ImportDocumentsRequest, ImportDocumentsResponse, ImportDocumentsMetadata> + importDocumentsOperationSettings() { + return getStubSettingsBuilder().importDocumentsOperationSettings(); + } + + /** Returns the builder for the settings used for calls to purgeDocuments. */ + public UnaryCallSettings.Builder purgeDocumentsSettings() { + return getStubSettingsBuilder().purgeDocumentsSettings(); + } + + /** Returns the builder for the settings used for calls to purgeDocuments. */ + public OperationCallSettings.Builder< + PurgeDocumentsRequest, PurgeDocumentsResponse, PurgeDocumentsMetadata> + purgeDocumentsOperationSettings() { + return getStubSettingsBuilder().purgeDocumentsOperationSettings(); + } + + @Override + public DocumentServiceSettings build() throws IOException { + return new DocumentServiceSettings(this); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceClient.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceClient.java new file mode 100644 index 000000000000..a5cee701a056 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceClient.java @@ -0,0 +1,290 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.discoveryengine.v1alpha.stub.RecommendationServiceStub; +import com.google.cloud.discoveryengine.v1alpha.stub.RecommendationServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for making recommendations. + * + *

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

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RecommendationServiceClient recommendationServiceClient =
+ *     RecommendationServiceClient.create()) {
+ *   RecommendRequest request =
+ *       RecommendRequest.newBuilder()
+ *           .setServingConfig(
+ *               ServingConfigName.ofProjectLocationDataStoreServingConfigName(
+ *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]")
+ *                   .toString())
+ *           .setUserEvent(UserEvent.newBuilder().build())
+ *           .setPageSize(883849137)
+ *           .setFilter("filter-1274492040")
+ *           .setValidateOnly(true)
+ *           .putAllParams(new HashMap())
+ *           .putAllUserLabels(new HashMap())
+ *           .build();
+ *   RecommendResponse response = recommendationServiceClient.recommend(request);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the RecommendationServiceClient 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 RecommendationServiceSettings + * to create(). For example: + * + *

To customize credentials: + * + *

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

To customize the endpoint: + * + *

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

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

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RecommendationServiceClient recommendationServiceClient =
+   *     RecommendationServiceClient.create()) {
+   *   RecommendRequest request =
+   *       RecommendRequest.newBuilder()
+   *           .setServingConfig(
+   *               ServingConfigName.ofProjectLocationDataStoreServingConfigName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .setUserEvent(UserEvent.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setFilter("filter-1274492040")
+   *           .setValidateOnly(true)
+   *           .putAllParams(new HashMap())
+   *           .putAllUserLabels(new HashMap())
+   *           .build();
+   *   RecommendResponse response = recommendationServiceClient.recommend(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 RecommendResponse recommend(RecommendRequest request) { + return recommendCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Makes a recommendation, which requires a contextual user event. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RecommendationServiceClient recommendationServiceClient =
+   *     RecommendationServiceClient.create()) {
+   *   RecommendRequest request =
+   *       RecommendRequest.newBuilder()
+   *           .setServingConfig(
+   *               ServingConfigName.ofProjectLocationDataStoreServingConfigName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .setUserEvent(UserEvent.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setFilter("filter-1274492040")
+   *           .setValidateOnly(true)
+   *           .putAllParams(new HashMap())
+   *           .putAllUserLabels(new HashMap())
+   *           .build();
+   *   ApiFuture future =
+   *       recommendationServiceClient.recommendCallable().futureCall(request);
+   *   // Do something.
+   *   RecommendResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable recommendCallable() { + return stub.recommendCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceSettings.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceSettings.java new file mode 100644 index 000000000000..4a3324e08812 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceSettings.java @@ -0,0 +1,209 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.discoveryengine.v1alpha.stub.RecommendationServiceStubSettings; +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 RecommendationServiceClient}. + * + *

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

    + *
  • The default service address (discoveryengine.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 recommend to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RecommendationServiceSettings.Builder recommendationServiceSettingsBuilder =
+ *     RecommendationServiceSettings.newBuilder();
+ * recommendationServiceSettingsBuilder
+ *     .recommendSettings()
+ *     .setRetrySettings(
+ *         recommendationServiceSettingsBuilder
+ *             .recommendSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * RecommendationServiceSettings recommendationServiceSettings =
+ *     recommendationServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class RecommendationServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to recommend. */ + public UnaryCallSettings recommendSettings() { + return ((RecommendationServiceStubSettings) getStubSettings()).recommendSettings(); + } + + public static final RecommendationServiceSettings create(RecommendationServiceStubSettings stub) + throws IOException { + return new RecommendationServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return RecommendationServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return RecommendationServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return RecommendationServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return RecommendationServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return RecommendationServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return RecommendationServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return RecommendationServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RecommendationServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RecommendationServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for RecommendationServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(RecommendationServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(RecommendationServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(RecommendationServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(RecommendationServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(RecommendationServiceStubSettings.newHttpJsonBuilder()); + } + + public RecommendationServiceStubSettings.Builder getStubSettingsBuilder() { + return ((RecommendationServiceStubSettings.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 recommend. */ + public UnaryCallSettings.Builder recommendSettings() { + return getStubSettingsBuilder().recommendSettings(); + } + + @Override + public RecommendationServiceSettings build() throws IOException { + return new RecommendationServiceSettings(this); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceClient.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceClient.java new file mode 100644 index 000000000000..92ab547720c8 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceClient.java @@ -0,0 +1,1033 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.discoveryengine.v1alpha.stub.SchemaServiceStub; +import com.google.cloud.discoveryengine.v1alpha.stub.SchemaServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +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 [Schema][google.cloud.discoveryengine.v1alpha.Schema]s. + * + *

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

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+ *   SchemaName name =
+ *       SchemaName.ofProjectLocationDataStoreSchemaName(
+ *           "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]");
+ *   Schema response = schemaServiceClient.getSchema(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the SchemaServiceClient 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 SchemaServiceSettings to + * create(). For example: + * + *

To customize credentials: + * + *

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

To customize the endpoint: + * + *

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

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

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class SchemaServiceClient implements BackgroundResource { + private final SchemaServiceSettings settings; + private final SchemaServiceStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of SchemaServiceClient with default settings. */ + public static final SchemaServiceClient create() throws IOException { + return create(SchemaServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SchemaServiceClient, 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 SchemaServiceClient create(SchemaServiceSettings settings) + throws IOException { + return new SchemaServiceClient(settings); + } + + /** + * Constructs an instance of SchemaServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(SchemaServiceSettings). + */ + public static final SchemaServiceClient create(SchemaServiceStub stub) { + return new SchemaServiceClient(stub); + } + + /** + * Constructs an instance of SchemaServiceClient, 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 SchemaServiceClient(SchemaServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SchemaServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected SchemaServiceClient(SchemaServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final SchemaServiceSettings getSettings() { + return settings; + } + + public SchemaServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   SchemaName name =
+   *       SchemaName.ofProjectLocationDataStoreSchemaName(
+   *           "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]");
+   *   Schema response = schemaServiceClient.getSchema(name);
+   * }
+   * }
+ * + * @param name Required. The full resource name of the schema, in the format of + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Schema getSchema(SchemaName name) { + GetSchemaRequest request = + GetSchemaRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getSchema(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   String name =
+   *       SchemaName.ofProjectLocationDataStoreSchemaName(
+   *               "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]")
+   *           .toString();
+   *   Schema response = schemaServiceClient.getSchema(name);
+   * }
+   * }
+ * + * @param name Required. The full resource name of the schema, in the format of + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Schema getSchema(String name) { + GetSchemaRequest request = GetSchemaRequest.newBuilder().setName(name).build(); + return getSchema(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   GetSchemaRequest request =
+   *       GetSchemaRequest.newBuilder()
+   *           .setName(
+   *               SchemaName.ofProjectLocationDataStoreSchemaName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]")
+   *                   .toString())
+   *           .build();
+   *   Schema response = schemaServiceClient.getSchema(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 Schema getSchema(GetSchemaRequest request) { + return getSchemaCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   GetSchemaRequest request =
+   *       GetSchemaRequest.newBuilder()
+   *           .setName(
+   *               SchemaName.ofProjectLocationDataStoreSchemaName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = schemaServiceClient.getSchemaCallable().futureCall(request);
+   *   // Do something.
+   *   Schema response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getSchemaCallable() { + return stub.getSchemaCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Schema][google.cloud.discoveryengine.v1alpha.Schema]s. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   DataStoreName parent =
+   *       DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]");
+   *   for (Schema element : schemaServiceClient.listSchemas(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent data store resource name, in the format of + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSchemasPagedResponse listSchemas(DataStoreName parent) { + ListSchemasRequest request = + ListSchemasRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listSchemas(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Schema][google.cloud.discoveryengine.v1alpha.Schema]s. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   String parent =
+   *       DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *           .toString();
+   *   for (Schema element : schemaServiceClient.listSchemas(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent data store resource name, in the format of + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSchemasPagedResponse listSchemas(String parent) { + ListSchemasRequest request = ListSchemasRequest.newBuilder().setParent(parent).build(); + return listSchemas(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Schema][google.cloud.discoveryengine.v1alpha.Schema]s. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   ListSchemasRequest request =
+   *       ListSchemasRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Schema element : schemaServiceClient.listSchemas(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 ListSchemasPagedResponse listSchemas(ListSchemasRequest request) { + return listSchemasPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Schema][google.cloud.discoveryengine.v1alpha.Schema]s. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   ListSchemasRequest request =
+   *       ListSchemasRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = schemaServiceClient.listSchemasPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Schema element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listSchemasPagedCallable() { + return stub.listSchemasPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a list of [Schema][google.cloud.discoveryengine.v1alpha.Schema]s. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   ListSchemasRequest request =
+   *       ListSchemasRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListSchemasResponse response = schemaServiceClient.listSchemasCallable().call(request);
+   *     for (Schema element : response.getSchemasList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listSchemasCallable() { + return stub.listSchemasCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   DataStoreName parent =
+   *       DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]");
+   *   Schema schema = Schema.newBuilder().build();
+   *   String schemaId = "schemaId-697673060";
+   *   Schema response = schemaServiceClient.createSchemaAsync(parent, schema, schemaId).get();
+   * }
+   * }
+ * + * @param parent Required. The parent data store resource name, in the format of + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + * @param schema Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to create. + * @param schemaId Required. The ID to use for the + * [Schema][google.cloud.discoveryengine.v1alpha.Schema], which will become the final + * component of the [Schema.name][google.cloud.discoveryengine.v1alpha.Schema.name]. + *

This field should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard + * with a length limit of 63 characters. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSchemaAsync( + DataStoreName parent, Schema schema, String schemaId) { + CreateSchemaRequest request = + CreateSchemaRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSchema(schema) + .setSchemaId(schemaId) + .build(); + return createSchemaAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   String parent =
+   *       DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *           .toString();
+   *   Schema schema = Schema.newBuilder().build();
+   *   String schemaId = "schemaId-697673060";
+   *   Schema response = schemaServiceClient.createSchemaAsync(parent, schema, schemaId).get();
+   * }
+   * }
+ * + * @param parent Required. The parent data store resource name, in the format of + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + * @param schema Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to create. + * @param schemaId Required. The ID to use for the + * [Schema][google.cloud.discoveryengine.v1alpha.Schema], which will become the final + * component of the [Schema.name][google.cloud.discoveryengine.v1alpha.Schema.name]. + *

This field should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard + * with a length limit of 63 characters. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSchemaAsync( + String parent, Schema schema, String schemaId) { + CreateSchemaRequest request = + CreateSchemaRequest.newBuilder() + .setParent(parent) + .setSchema(schema) + .setSchemaId(schemaId) + .build(); + return createSchemaAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   CreateSchemaRequest request =
+   *       CreateSchemaRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .setSchema(Schema.newBuilder().build())
+   *           .setSchemaId("schemaId-697673060")
+   *           .build();
+   *   Schema response = schemaServiceClient.createSchemaAsync(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 createSchemaAsync( + CreateSchemaRequest request) { + return createSchemaOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   CreateSchemaRequest request =
+   *       CreateSchemaRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .setSchema(Schema.newBuilder().build())
+   *           .setSchemaId("schemaId-697673060")
+   *           .build();
+   *   OperationFuture future =
+   *       schemaServiceClient.createSchemaOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Schema response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createSchemaOperationCallable() { + return stub.createSchemaOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   CreateSchemaRequest request =
+   *       CreateSchemaRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .setSchema(Schema.newBuilder().build())
+   *           .setSchemaId("schemaId-697673060")
+   *           .build();
+   *   ApiFuture future = schemaServiceClient.createSchemaCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createSchemaCallable() { + return stub.createSchemaCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   UpdateSchemaRequest request =
+   *       UpdateSchemaRequest.newBuilder()
+   *           .setSchema(Schema.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   Schema response = schemaServiceClient.updateSchemaAsync(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 updateSchemaAsync( + UpdateSchemaRequest request) { + return updateSchemaOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   UpdateSchemaRequest request =
+   *       UpdateSchemaRequest.newBuilder()
+   *           .setSchema(Schema.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   OperationFuture future =
+   *       schemaServiceClient.updateSchemaOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Schema response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateSchemaOperationCallable() { + return stub.updateSchemaOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   UpdateSchemaRequest request =
+   *       UpdateSchemaRequest.newBuilder()
+   *           .setSchema(Schema.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .build();
+   *   ApiFuture future = schemaServiceClient.updateSchemaCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateSchemaCallable() { + return stub.updateSchemaCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   SchemaName name =
+   *       SchemaName.ofProjectLocationDataStoreSchemaName(
+   *           "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]");
+   *   schemaServiceClient.deleteSchemaAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The full resource name of the schema, in the format of + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteSchemaAsync(SchemaName name) { + DeleteSchemaRequest request = + DeleteSchemaRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteSchemaAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   String name =
+   *       SchemaName.ofProjectLocationDataStoreSchemaName(
+   *               "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]")
+   *           .toString();
+   *   schemaServiceClient.deleteSchemaAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The full resource name of the schema, in the format of + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteSchemaAsync(String name) { + DeleteSchemaRequest request = DeleteSchemaRequest.newBuilder().setName(name).build(); + return deleteSchemaAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   DeleteSchemaRequest request =
+   *       DeleteSchemaRequest.newBuilder()
+   *           .setName(
+   *               SchemaName.ofProjectLocationDataStoreSchemaName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]")
+   *                   .toString())
+   *           .build();
+   *   schemaServiceClient.deleteSchemaAsync(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 deleteSchemaAsync( + DeleteSchemaRequest request) { + return deleteSchemaOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   DeleteSchemaRequest request =
+   *       DeleteSchemaRequest.newBuilder()
+   *           .setName(
+   *               SchemaName.ofProjectLocationDataStoreSchemaName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]")
+   *                   .toString())
+   *           .build();
+   *   OperationFuture future =
+   *       schemaServiceClient.deleteSchemaOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteSchemaOperationCallable() { + return stub.deleteSchemaOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+   *   DeleteSchemaRequest request =
+   *       DeleteSchemaRequest.newBuilder()
+   *           .setName(
+   *               SchemaName.ofProjectLocationDataStoreSchemaName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = schemaServiceClient.deleteSchemaCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteSchemaCallable() { + return stub.deleteSchemaCallable(); + } + + @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 ListSchemasPagedResponse + extends AbstractPagedListResponse< + ListSchemasRequest, + ListSchemasResponse, + Schema, + ListSchemasPage, + ListSchemasFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSchemasPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListSchemasPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListSchemasPagedResponse(ListSchemasPage page) { + super(page, ListSchemasFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSchemasPage + extends AbstractPage { + + private ListSchemasPage( + PageContext context, + ListSchemasResponse response) { + super(context, response); + } + + private static ListSchemasPage createEmptyPage() { + return new ListSchemasPage(null, null); + } + + @Override + protected ListSchemasPage createPage( + PageContext context, + ListSchemasResponse response) { + return new ListSchemasPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSchemasFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSchemasRequest, + ListSchemasResponse, + Schema, + ListSchemasPage, + ListSchemasFixedSizeCollection> { + + private ListSchemasFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSchemasFixedSizeCollection createEmptyCollection() { + return new ListSchemasFixedSizeCollection(null, 0); + } + + @Override + protected ListSchemasFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSchemasFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceSettings.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceSettings.java new file mode 100644 index 000000000000..3ef01f326c1a --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceSettings.java @@ -0,0 +1,291 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import static com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient.ListSchemasPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.discoveryengine.v1alpha.stub.SchemaServiceStubSettings; +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 SchemaServiceClient}. + * + *

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

    + *
  • The default service address (discoveryengine.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 getSchema to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SchemaServiceSettings.Builder schemaServiceSettingsBuilder = SchemaServiceSettings.newBuilder();
+ * schemaServiceSettingsBuilder
+ *     .getSchemaSettings()
+ *     .setRetrySettings(
+ *         schemaServiceSettingsBuilder
+ *             .getSchemaSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SchemaServiceSettings schemaServiceSettings = schemaServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class SchemaServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to getSchema. */ + public UnaryCallSettings getSchemaSettings() { + return ((SchemaServiceStubSettings) getStubSettings()).getSchemaSettings(); + } + + /** Returns the object with the settings used for calls to listSchemas. */ + public PagedCallSettings + listSchemasSettings() { + return ((SchemaServiceStubSettings) getStubSettings()).listSchemasSettings(); + } + + /** Returns the object with the settings used for calls to createSchema. */ + public UnaryCallSettings createSchemaSettings() { + return ((SchemaServiceStubSettings) getStubSettings()).createSchemaSettings(); + } + + /** Returns the object with the settings used for calls to createSchema. */ + public OperationCallSettings + createSchemaOperationSettings() { + return ((SchemaServiceStubSettings) getStubSettings()).createSchemaOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateSchema. */ + public UnaryCallSettings updateSchemaSettings() { + return ((SchemaServiceStubSettings) getStubSettings()).updateSchemaSettings(); + } + + /** Returns the object with the settings used for calls to updateSchema. */ + public OperationCallSettings + updateSchemaOperationSettings() { + return ((SchemaServiceStubSettings) getStubSettings()).updateSchemaOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteSchema. */ + public UnaryCallSettings deleteSchemaSettings() { + return ((SchemaServiceStubSettings) getStubSettings()).deleteSchemaSettings(); + } + + /** Returns the object with the settings used for calls to deleteSchema. */ + public OperationCallSettings + deleteSchemaOperationSettings() { + return ((SchemaServiceStubSettings) getStubSettings()).deleteSchemaOperationSettings(); + } + + public static final SchemaServiceSettings create(SchemaServiceStubSettings stub) + throws IOException { + return new SchemaServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SchemaServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SchemaServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SchemaServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SchemaServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SchemaServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SchemaServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SchemaServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SchemaServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SchemaServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SchemaServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(SchemaServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SchemaServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SchemaServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SchemaServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(SchemaServiceStubSettings.newHttpJsonBuilder()); + } + + public SchemaServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SchemaServiceStubSettings.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 getSchema. */ + public UnaryCallSettings.Builder getSchemaSettings() { + return getStubSettingsBuilder().getSchemaSettings(); + } + + /** Returns the builder for the settings used for calls to listSchemas. */ + public PagedCallSettings.Builder< + ListSchemasRequest, ListSchemasResponse, ListSchemasPagedResponse> + listSchemasSettings() { + return getStubSettingsBuilder().listSchemasSettings(); + } + + /** Returns the builder for the settings used for calls to createSchema. */ + public UnaryCallSettings.Builder createSchemaSettings() { + return getStubSettingsBuilder().createSchemaSettings(); + } + + /** Returns the builder for the settings used for calls to createSchema. */ + public OperationCallSettings.Builder + createSchemaOperationSettings() { + return getStubSettingsBuilder().createSchemaOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateSchema. */ + public UnaryCallSettings.Builder updateSchemaSettings() { + return getStubSettingsBuilder().updateSchemaSettings(); + } + + /** Returns the builder for the settings used for calls to updateSchema. */ + public OperationCallSettings.Builder + updateSchemaOperationSettings() { + return getStubSettingsBuilder().updateSchemaOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSchema. */ + public UnaryCallSettings.Builder deleteSchemaSettings() { + return getStubSettingsBuilder().deleteSchemaSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSchema. */ + public OperationCallSettings.Builder + deleteSchemaOperationSettings() { + return getStubSettingsBuilder().deleteSchemaOperationSettings(); + } + + @Override + public SchemaServiceSettings build() throws IOException { + return new SchemaServiceSettings(this); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceClient.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceClient.java new file mode 100644 index 000000000000..029d5edd69d8 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceClient.java @@ -0,0 +1,483 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +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.discoveryengine.v1alpha.stub.SearchServiceStub; +import com.google.cloud.discoveryengine.v1alpha.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 class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) {
+ *   SearchRequest request =
+ *       SearchRequest.newBuilder()
+ *           .setServingConfig(
+ *               ServingConfigName.ofProjectLocationDataStoreServingConfigName(
+ *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]")
+ *                   .toString())
+ *           .setBranch(
+ *               BranchName.ofProjectLocationDataStoreBranchName(
+ *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]")
+ *                   .toString())
+ *           .setQuery("query107944136")
+ *           .setImageQuery(SearchRequest.ImageQuery.newBuilder().build())
+ *           .setPageSize(883849137)
+ *           .setPageToken("pageToken873572522")
+ *           .setOffset(-1019779949)
+ *           .setFilter("filter-1274492040")
+ *           .setOrderBy("orderBy-1207110587")
+ *           .setUserInfo(UserInfo.newBuilder().build())
+ *           .addAllFacetSpecs(new ArrayList())
+ *           .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build())
+ *           .putAllParams(new HashMap())
+ *           .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build())
+ *           .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build())
+ *           .setUserPseudoId("userPseudoId-1155274652")
+ *           .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build())
+ *           .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build())
+ *           .setRankingExpression("rankingExpression2110320494")
+ *           .setSafeSearch(true)
+ *           .putAllUserLabels(new HashMap())
+ *           .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 and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * 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 and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SearchServiceSettings searchServiceSettings =
+ *     SearchServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SearchServiceClient searchServiceClient = SearchServiceClient.create(searchServiceSettings);
+ * }
+ * + *

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

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SearchServiceSettings searchServiceSettings =
+ *     SearchServiceSettings.newHttpJsonBuilder().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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) {
+   *   SearchRequest request =
+   *       SearchRequest.newBuilder()
+   *           .setServingConfig(
+   *               ServingConfigName.ofProjectLocationDataStoreServingConfigName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .setBranch(
+   *               BranchName.ofProjectLocationDataStoreBranchName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]")
+   *                   .toString())
+   *           .setQuery("query107944136")
+   *           .setImageQuery(SearchRequest.ImageQuery.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOffset(-1019779949)
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setUserInfo(UserInfo.newBuilder().build())
+   *           .addAllFacetSpecs(new ArrayList())
+   *           .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build())
+   *           .putAllParams(new HashMap())
+   *           .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build())
+   *           .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build())
+   *           .setUserPseudoId("userPseudoId-1155274652")
+   *           .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build())
+   *           .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build())
+   *           .setRankingExpression("rankingExpression2110320494")
+   *           .setSafeSearch(true)
+   *           .putAllUserLabels(new HashMap())
+   *           .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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) {
+   *   SearchRequest request =
+   *       SearchRequest.newBuilder()
+   *           .setServingConfig(
+   *               ServingConfigName.ofProjectLocationDataStoreServingConfigName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .setBranch(
+   *               BranchName.ofProjectLocationDataStoreBranchName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]")
+   *                   .toString())
+   *           .setQuery("query107944136")
+   *           .setImageQuery(SearchRequest.ImageQuery.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOffset(-1019779949)
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setUserInfo(UserInfo.newBuilder().build())
+   *           .addAllFacetSpecs(new ArrayList())
+   *           .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build())
+   *           .putAllParams(new HashMap())
+   *           .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build())
+   *           .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build())
+   *           .setUserPseudoId("userPseudoId-1155274652")
+   *           .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build())
+   *           .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build())
+   *           .setRankingExpression("rankingExpression2110320494")
+   *           .setSafeSearch(true)
+   *           .putAllUserLabels(new HashMap())
+   *           .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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) {
+   *   SearchRequest request =
+   *       SearchRequest.newBuilder()
+   *           .setServingConfig(
+   *               ServingConfigName.ofProjectLocationDataStoreServingConfigName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]")
+   *                   .toString())
+   *           .setBranch(
+   *               BranchName.ofProjectLocationDataStoreBranchName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]")
+   *                   .toString())
+   *           .setQuery("query107944136")
+   *           .setImageQuery(SearchRequest.ImageQuery.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOffset(-1019779949)
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setUserInfo(UserInfo.newBuilder().build())
+   *           .addAllFacetSpecs(new ArrayList())
+   *           .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build())
+   *           .putAllParams(new HashMap())
+   *           .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build())
+   *           .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build())
+   *           .setUserPseudoId("userPseudoId-1155274652")
+   *           .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build())
+   *           .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build())
+   *           .setRankingExpression("rankingExpression2110320494")
+   *           .setSafeSearch(true)
+   *           .putAllUserLabels(new HashMap())
+   *           .build();
+   *   while (true) {
+   *     SearchResponse response = searchServiceClient.searchCallable().call(request);
+   *     for (SearchResponse.SearchResult element : response.getResultsList()) {
+   *       // 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/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceSettings.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceSettings.java new file mode 100644 index 000000000000..89d1e0bf357d --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceSettings.java @@ -0,0 +1,210 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import static com.google.cloud.discoveryengine.v1alpha.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.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.discoveryengine.v1alpha.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 (discoveryengine.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 and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * 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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SearchServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SearchServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + 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 gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected 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()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(SearchServiceStubSettings.newHttpJsonBuilder()); + } + + 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/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceClient.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceClient.java new file mode 100644 index 000000000000..db704d2a47fc --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceClient.java @@ -0,0 +1,340 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.discoveryengine.v1alpha.stub.SiteSearchEngineServiceStub; +import com.google.cloud.discoveryengine.v1alpha.stub.SiteSearchEngineServiceStubSettings; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for managing site search related resources. + * + *

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

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
+ *     SiteSearchEngineServiceClient.create()) {
+ *   RecrawlUrisRequest request =
+ *       RecrawlUrisRequest.newBuilder()
+ *           .setSiteSearchEngine(
+ *               SiteSearchEngineName.ofProjectLocationDataStoreName(
+ *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+ *                   .toString())
+ *           .addAllUris(new ArrayList())
+ *           .build();
+ *   RecrawlUrisResponse response = siteSearchEngineServiceClient.recrawlUrisAsync(request).get();
+ * }
+ * }
+ * + *

Note: close() needs to be called on the SiteSearchEngineServiceClient 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 + * SiteSearchEngineServiceSettings to create(). For example: + * + *

To customize credentials: + * + *

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

To customize the endpoint: + * + *

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

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

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class SiteSearchEngineServiceClient implements BackgroundResource { + private final SiteSearchEngineServiceSettings settings; + private final SiteSearchEngineServiceStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of SiteSearchEngineServiceClient with default settings. */ + public static final SiteSearchEngineServiceClient create() throws IOException { + return create(SiteSearchEngineServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SiteSearchEngineServiceClient, 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 SiteSearchEngineServiceClient create(SiteSearchEngineServiceSettings settings) + throws IOException { + return new SiteSearchEngineServiceClient(settings); + } + + /** + * Constructs an instance of SiteSearchEngineServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(SiteSearchEngineServiceSettings). + */ + public static final SiteSearchEngineServiceClient create(SiteSearchEngineServiceStub stub) { + return new SiteSearchEngineServiceClient(stub); + } + + /** + * Constructs an instance of SiteSearchEngineServiceClient, 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 SiteSearchEngineServiceClient(SiteSearchEngineServiceSettings settings) + throws IOException { + this.settings = settings; + this.stub = ((SiteSearchEngineServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected SiteSearchEngineServiceClient(SiteSearchEngineServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final SiteSearchEngineServiceSettings getSettings() { + return settings; + } + + public SiteSearchEngineServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Request on-demand recrawl for a list of URIs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
+   *     SiteSearchEngineServiceClient.create()) {
+   *   RecrawlUrisRequest request =
+   *       RecrawlUrisRequest.newBuilder()
+   *           .setSiteSearchEngine(
+   *               SiteSearchEngineName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .addAllUris(new ArrayList())
+   *           .build();
+   *   RecrawlUrisResponse response = siteSearchEngineServiceClient.recrawlUrisAsync(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 recrawlUrisAsync( + RecrawlUrisRequest request) { + return recrawlUrisOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Request on-demand recrawl for a list of URIs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
+   *     SiteSearchEngineServiceClient.create()) {
+   *   RecrawlUrisRequest request =
+   *       RecrawlUrisRequest.newBuilder()
+   *           .setSiteSearchEngine(
+   *               SiteSearchEngineName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .addAllUris(new ArrayList())
+   *           .build();
+   *   OperationFuture future =
+   *       siteSearchEngineServiceClient.recrawlUrisOperationCallable().futureCall(request);
+   *   // Do something.
+   *   RecrawlUrisResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + recrawlUrisOperationCallable() { + return stub.recrawlUrisOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Request on-demand recrawl for a list of URIs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
+   *     SiteSearchEngineServiceClient.create()) {
+   *   RecrawlUrisRequest request =
+   *       RecrawlUrisRequest.newBuilder()
+   *           .setSiteSearchEngine(
+   *               SiteSearchEngineName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .addAllUris(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       siteSearchEngineServiceClient.recrawlUrisCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable recrawlUrisCallable() { + return stub.recrawlUrisCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceSettings.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceSettings.java new file mode 100644 index 000000000000..c2a85f5ad564 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceSettings.java @@ -0,0 +1,225 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.discoveryengine.v1alpha.stub.SiteSearchEngineServiceStubSettings; +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 SiteSearchEngineServiceClient}. + * + *

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

    + *
  • The default service address (discoveryengine.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 recrawlUris to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SiteSearchEngineServiceSettings.Builder siteSearchEngineServiceSettingsBuilder =
+ *     SiteSearchEngineServiceSettings.newBuilder();
+ * siteSearchEngineServiceSettingsBuilder
+ *     .recrawlUrisSettings()
+ *     .setRetrySettings(
+ *         siteSearchEngineServiceSettingsBuilder
+ *             .recrawlUrisSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SiteSearchEngineServiceSettings siteSearchEngineServiceSettings =
+ *     siteSearchEngineServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class SiteSearchEngineServiceSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to recrawlUris. */ + public UnaryCallSettings recrawlUrisSettings() { + return ((SiteSearchEngineServiceStubSettings) getStubSettings()).recrawlUrisSettings(); + } + + /** Returns the object with the settings used for calls to recrawlUris. */ + public OperationCallSettings + recrawlUrisOperationSettings() { + return ((SiteSearchEngineServiceStubSettings) getStubSettings()).recrawlUrisOperationSettings(); + } + + public static final SiteSearchEngineServiceSettings create( + SiteSearchEngineServiceStubSettings stub) throws IOException { + return new SiteSearchEngineServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SiteSearchEngineServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SiteSearchEngineServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SiteSearchEngineServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SiteSearchEngineServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SiteSearchEngineServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SiteSearchEngineServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SiteSearchEngineServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SiteSearchEngineServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SiteSearchEngineServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SiteSearchEngineServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(SiteSearchEngineServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SiteSearchEngineServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SiteSearchEngineServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SiteSearchEngineServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(SiteSearchEngineServiceStubSettings.newHttpJsonBuilder()); + } + + public SiteSearchEngineServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SiteSearchEngineServiceStubSettings.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 recrawlUris. */ + public UnaryCallSettings.Builder recrawlUrisSettings() { + return getStubSettingsBuilder().recrawlUrisSettings(); + } + + /** Returns the builder for the settings used for calls to recrawlUris. */ + public OperationCallSettings.Builder< + RecrawlUrisRequest, RecrawlUrisResponse, RecrawlUrisMetadata> + recrawlUrisOperationSettings() { + return getStubSettingsBuilder().recrawlUrisOperationSettings(); + } + + @Override + public SiteSearchEngineServiceSettings build() throws IOException { + return new SiteSearchEngineServiceSettings(this); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceClient.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceClient.java new file mode 100644 index 000000000000..3b11b210073e --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceClient.java @@ -0,0 +1,598 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.HttpBody; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.discoveryengine.v1alpha.stub.UserEventServiceStub; +import com.google.cloud.discoveryengine.v1alpha.stub.UserEventServiceStubSettings; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for ingesting end user actions on a website to Discovery Engine API. + * + *

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

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ *   WriteUserEventRequest request =
+ *       WriteUserEventRequest.newBuilder()
+ *           .setParent(
+ *               DataStoreName.ofProjectLocationDataStoreName(
+ *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+ *                   .toString())
+ *           .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 and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * 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 and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * UserEventServiceSettings userEventServiceSettings =
+ *     UserEventServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * UserEventServiceClient userEventServiceClient =
+ *     UserEventServiceClient.create(userEventServiceSettings);
+ * }
+ * + *

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

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * UserEventServiceSettings userEventServiceSettings =
+ *     UserEventServiceSettings.newHttpJsonBuilder().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 httpJsonOperationsClient; + private final com.google.longrunning.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 = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected UserEventServiceClient(UserEventServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final 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 com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Writes a single user event. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   WriteUserEventRequest request =
+   *       WriteUserEventRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .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 and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   WriteUserEventRequest request =
+   *       WriteUserEventRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .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 third-party domain. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   CollectUserEventRequest request =
+   *       CollectUserEventRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .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 third-party domain. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   CollectUserEventRequest request =
+   *       CollectUserEventRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .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 and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   PurgeUserEventsRequest request =
+   *       PurgeUserEventsRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .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 and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   PurgeUserEventsRequest request =
+   *       PurgeUserEventsRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .setFilter("filter-1274492040")
+   *           .setForce(true)
+   *           .build();
+   *   OperationFuture future =
+   *       userEventServiceClient.purgeUserEventsOperationCallable().futureCall(request);
+   *   // Do something.
+   *   PurgeUserEventsResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeUserEventsMetadata> + 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 and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   PurgeUserEventsRequest request =
+   *       PurgeUserEventsRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .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 and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   ImportUserEventsRequest request =
+   *       ImportUserEventsRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .setErrorConfig(ImportErrorConfig.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 and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   ImportUserEventsRequest request =
+   *       ImportUserEventsRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .setErrorConfig(ImportErrorConfig.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       userEventServiceClient.importUserEventsOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ImportUserEventsResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + ImportUserEventsRequest, ImportUserEventsResponse, ImportUserEventsMetadata> + 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 and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+   *   ImportUserEventsRequest request =
+   *       ImportUserEventsRequest.newBuilder()
+   *           .setParent(
+   *               DataStoreName.ofProjectLocationDataStoreName(
+   *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+   *                   .toString())
+   *           .setErrorConfig(ImportErrorConfig.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       userEventServiceClient.importUserEventsCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable importUserEventsCallable() { + return stub.importUserEventsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceSettings.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceSettings.java new file mode 100644 index 000000000000..c1cb18161a0d --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceSettings.java @@ -0,0 +1,269 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +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.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.discoveryengine.v1alpha.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 (discoveryengine.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 and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * 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< + PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeUserEventsMetadata> + 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< + ImportUserEventsRequest, ImportUserEventsResponse, ImportUserEventsMetadata> + importUserEventsOperationSettings() { + return ((UserEventServiceStubSettings) getStubSettings()).importUserEventsOperationSettings(); + } + + 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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return UserEventServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return UserEventServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + 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 gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected 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()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(UserEventServiceStubSettings.newHttpJsonBuilder()); + } + + 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, PurgeUserEventsMetadata> + 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, ImportUserEventsMetadata> + importUserEventsOperationSettings() { + return getStubSettingsBuilder().importUserEventsOperationSettings(); + } + + @Override + public UserEventServiceSettings build() throws IOException { + return new UserEventServiceSettings(this); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/gapic_metadata.json b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/gapic_metadata.json new file mode 100644 index 000000000000..482a49faa432 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/gapic_metadata.json @@ -0,0 +1,159 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.discoveryengine.v1alpha", + "libraryPackage": "com.google.cloud.discoveryengine.v1alpha", + "services": { + "CompletionService": { + "clients": { + "grpc": { + "libraryClient": "CompletionServiceClient", + "rpcs": { + "CompleteQuery": { + "methods": ["completeQuery", "completeQueryCallable"] + } + } + } + } + }, + "ConversationalSearchService": { + "clients": { + "grpc": { + "libraryClient": "ConversationalSearchServiceClient", + "rpcs": { + "ConverseConversation": { + "methods": ["converseConversation", "converseConversation", "converseConversation", "converseConversationCallable"] + }, + "CreateConversation": { + "methods": ["createConversation", "createConversation", "createConversation", "createConversationCallable"] + }, + "DeleteConversation": { + "methods": ["deleteConversation", "deleteConversation", "deleteConversation", "deleteConversationCallable"] + }, + "GetConversation": { + "methods": ["getConversation", "getConversation", "getConversation", "getConversationCallable"] + }, + "ListConversations": { + "methods": ["listConversations", "listConversations", "listConversations", "listConversationsPagedCallable", "listConversationsCallable"] + }, + "UpdateConversation": { + "methods": ["updateConversation", "updateConversation", "updateConversationCallable"] + } + } + } + } + }, + "DocumentService": { + "clients": { + "grpc": { + "libraryClient": "DocumentServiceClient", + "rpcs": { + "CreateDocument": { + "methods": ["createDocument", "createDocument", "createDocument", "createDocumentCallable"] + }, + "DeleteDocument": { + "methods": ["deleteDocument", "deleteDocument", "deleteDocument", "deleteDocumentCallable"] + }, + "GetDocument": { + "methods": ["getDocument", "getDocument", "getDocument", "getDocumentCallable"] + }, + "ImportDocuments": { + "methods": ["importDocumentsAsync", "importDocumentsOperationCallable", "importDocumentsCallable"] + }, + "ListDocuments": { + "methods": ["listDocuments", "listDocuments", "listDocuments", "listDocumentsPagedCallable", "listDocumentsCallable"] + }, + "PurgeDocuments": { + "methods": ["purgeDocumentsAsync", "purgeDocumentsOperationCallable", "purgeDocumentsCallable"] + }, + "UpdateDocument": { + "methods": ["updateDocument", "updateDocumentCallable"] + } + } + } + } + }, + "RecommendationService": { + "clients": { + "grpc": { + "libraryClient": "RecommendationServiceClient", + "rpcs": { + "Recommend": { + "methods": ["recommend", "recommendCallable"] + } + } + } + } + }, + "SchemaService": { + "clients": { + "grpc": { + "libraryClient": "SchemaServiceClient", + "rpcs": { + "CreateSchema": { + "methods": ["createSchemaAsync", "createSchemaAsync", "createSchemaAsync", "createSchemaOperationCallable", "createSchemaCallable"] + }, + "DeleteSchema": { + "methods": ["deleteSchemaAsync", "deleteSchemaAsync", "deleteSchemaAsync", "deleteSchemaOperationCallable", "deleteSchemaCallable"] + }, + "GetSchema": { + "methods": ["getSchema", "getSchema", "getSchema", "getSchemaCallable"] + }, + "ListSchemas": { + "methods": ["listSchemas", "listSchemas", "listSchemas", "listSchemasPagedCallable", "listSchemasCallable"] + }, + "UpdateSchema": { + "methods": ["updateSchemaAsync", "updateSchemaOperationCallable", "updateSchemaCallable"] + } + } + } + } + }, + "SearchService": { + "clients": { + "grpc": { + "libraryClient": "SearchServiceClient", + "rpcs": { + "Search": { + "methods": ["search", "searchPagedCallable", "searchCallable"] + } + } + } + } + }, + "SiteSearchEngineService": { + "clients": { + "grpc": { + "libraryClient": "SiteSearchEngineServiceClient", + "rpcs": { + "RecrawlUris": { + "methods": ["recrawlUrisAsync", "recrawlUrisOperationCallable", "recrawlUrisCallable"] + } + } + } + } + }, + "UserEventService": { + "clients": { + "grpc": { + "libraryClient": "UserEventServiceClient", + "rpcs": { + "CollectUserEvent": { + "methods": ["collectUserEvent", "collectUserEventCallable"] + }, + "ImportUserEvents": { + "methods": ["importUserEventsAsync", "importUserEventsOperationCallable", "importUserEventsCallable"] + }, + "PurgeUserEvents": { + "methods": ["purgeUserEventsAsync", "purgeUserEventsOperationCallable", "purgeUserEventsCallable"] + }, + "WriteUserEvent": { + "methods": ["writeUserEvent", "writeUserEventCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/package-info.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/package-info.java new file mode 100644 index 000000000000..a2db6dca5faa --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/package-info.java @@ -0,0 +1,250 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Discovery Engine API + * + *

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

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

Service Description: Service for Auto-Completion. + * + *

Sample for CompletionServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
+ *   CompleteQueryRequest request =
+ *       CompleteQueryRequest.newBuilder()
+ *           .setDataStore(
+ *               DataStoreName.ofProjectLocationDataStoreName(
+ *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+ *                   .toString())
+ *           .setQuery("query107944136")
+ *           .setQueryModel("queryModel-184930495")
+ *           .setUserPseudoId("userPseudoId-1155274652")
+ *           .setIncludeTailSuggestions(true)
+ *           .build();
+ *   CompleteQueryResponse response = completionServiceClient.completeQuery(request);
+ * }
+ * }
+ * + *

======================= ConversationalSearchServiceClient ======================= + * + *

Service Description: Service for conversational search. + * + *

Sample for ConversationalSearchServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConversationalSearchServiceClient conversationalSearchServiceClient =
+ *     ConversationalSearchServiceClient.create()) {
+ *   ConversationName name =
+ *       ConversationName.ofProjectLocationDataStoreConversationName(
+ *           "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]");
+ *   TextInput query = TextInput.newBuilder().build();
+ *   ConverseConversationResponse response =
+ *       conversationalSearchServiceClient.converseConversation(name, query);
+ * }
+ * }
+ * + *

======================= DocumentServiceClient ======================= + * + *

Service Description: Service for ingesting + * [Document][google.cloud.discoveryengine.v1alpha.Document] information of the customer's website. + * + *

Sample for DocumentServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
+ *   DocumentName name =
+ *       DocumentName.ofProjectLocationDataStoreBranchDocumentName(
+ *           "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]");
+ *   Document response = documentServiceClient.getDocument(name);
+ * }
+ * }
+ * + *

======================= RecommendationServiceClient ======================= + * + *

Service Description: Service for making recommendations. + * + *

Sample for RecommendationServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RecommendationServiceClient recommendationServiceClient =
+ *     RecommendationServiceClient.create()) {
+ *   RecommendRequest request =
+ *       RecommendRequest.newBuilder()
+ *           .setServingConfig(
+ *               ServingConfigName.ofProjectLocationDataStoreServingConfigName(
+ *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]")
+ *                   .toString())
+ *           .setUserEvent(UserEvent.newBuilder().build())
+ *           .setPageSize(883849137)
+ *           .setFilter("filter-1274492040")
+ *           .setValidateOnly(true)
+ *           .putAllParams(new HashMap())
+ *           .putAllUserLabels(new HashMap())
+ *           .build();
+ *   RecommendResponse response = recommendationServiceClient.recommend(request);
+ * }
+ * }
+ * + *

======================= SchemaServiceClient ======================= + * + *

Service Description: Service for managing + * [Schema][google.cloud.discoveryengine.v1alpha.Schema]s. + * + *

Sample for SchemaServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
+ *   SchemaName name =
+ *       SchemaName.ofProjectLocationDataStoreSchemaName(
+ *           "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]");
+ *   Schema response = schemaServiceClient.getSchema(name);
+ * }
+ * }
+ * + *

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

Service Description: Service for search. + * + *

Sample for SearchServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) {
+ *   SearchRequest request =
+ *       SearchRequest.newBuilder()
+ *           .setServingConfig(
+ *               ServingConfigName.ofProjectLocationDataStoreServingConfigName(
+ *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]")
+ *                   .toString())
+ *           .setBranch(
+ *               BranchName.ofProjectLocationDataStoreBranchName(
+ *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]")
+ *                   .toString())
+ *           .setQuery("query107944136")
+ *           .setImageQuery(SearchRequest.ImageQuery.newBuilder().build())
+ *           .setPageSize(883849137)
+ *           .setPageToken("pageToken873572522")
+ *           .setOffset(-1019779949)
+ *           .setFilter("filter-1274492040")
+ *           .setOrderBy("orderBy-1207110587")
+ *           .setUserInfo(UserInfo.newBuilder().build())
+ *           .addAllFacetSpecs(new ArrayList())
+ *           .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build())
+ *           .putAllParams(new HashMap())
+ *           .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build())
+ *           .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build())
+ *           .setUserPseudoId("userPseudoId-1155274652")
+ *           .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build())
+ *           .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build())
+ *           .setRankingExpression("rankingExpression2110320494")
+ *           .setSafeSearch(true)
+ *           .putAllUserLabels(new HashMap())
+ *           .build();
+ *   for (SearchResponse.SearchResult element : searchServiceClient.search(request).iterateAll()) {
+ *     // doThingsWith(element);
+ *   }
+ * }
+ * }
+ * + *

======================= SiteSearchEngineServiceClient ======================= + * + *

Service Description: Service for managing site search related resources. + * + *

Sample for SiteSearchEngineServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SiteSearchEngineServiceClient siteSearchEngineServiceClient =
+ *     SiteSearchEngineServiceClient.create()) {
+ *   RecrawlUrisRequest request =
+ *       RecrawlUrisRequest.newBuilder()
+ *           .setSiteSearchEngine(
+ *               SiteSearchEngineName.ofProjectLocationDataStoreName(
+ *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+ *                   .toString())
+ *           .addAllUris(new ArrayList())
+ *           .build();
+ *   RecrawlUrisResponse response = siteSearchEngineServiceClient.recrawlUrisAsync(request).get();
+ * }
+ * }
+ * + *

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

Service Description: Service for ingesting end user actions on a website to Discovery Engine + * API. + * + *

Sample for UserEventServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ *   WriteUserEventRequest request =
+ *       WriteUserEventRequest.newBuilder()
+ *           .setParent(
+ *               DataStoreName.ofProjectLocationDataStoreName(
+ *                       "[PROJECT]", "[LOCATION]", "[DATA_STORE]")
+ *                   .toString())
+ *           .setUserEvent(UserEvent.newBuilder().build())
+ *           .build();
+ *   UserEvent response = userEventServiceClient.writeUserEvent(request);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.discoveryengine.v1alpha; + +import javax.annotation.Generated; diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/CompletionServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/CompletionServiceStub.java new file mode 100644 index 000000000000..3ca327a6e9e9 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/CompletionServiceStub.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.CompleteQueryRequest; +import com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse; +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 UnaryCallable completeQueryCallable() { + throw new UnsupportedOperationException("Not implemented: completeQueryCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/CompletionServiceStubSettings.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/CompletionServiceStubSettings.java new file mode 100644 index 000000000000..7974040d21d9 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/CompletionServiceStubSettings.java @@ -0,0 +1,331 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.discoveryengine.v1alpha.CompleteQueryRequest; +import com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse; +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 CompletionServiceStub}. + * + *

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

    + *
  • The default service address (discoveryengine.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 and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * 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; + + /** Returns the object with the settings used for calls to completeQuery. */ + public UnaryCallSettings completeQuerySettings() { + return completeQuerySettings; + } + + public CompletionServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCompletionServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonCompletionServiceStub.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 "discoveryengine.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "discoveryengine.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CompletionServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CompletionServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CompletionServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected CompletionServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + completeQuerySettings = settingsBuilder.completeQuerySettings().build(); + } + + /** Builder for CompletionServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + completeQuerySettings; + 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))); + 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(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(completeQuerySettings); + initDefaults(this); + } + + protected Builder(CompletionServiceStubSettings settings) { + super(settings); + + completeQuerySettings = settings.completeQuerySettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(completeQuerySettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .completeQuerySettings() + .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 completeQuery. */ + public UnaryCallSettings.Builder + completeQuerySettings() { + return completeQuerySettings; + } + + @Override + public CompletionServiceStubSettings build() throws IOException { + return new CompletionServiceStubSettings(this); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/ConversationalSearchServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/ConversationalSearchServiceStub.java new file mode 100644 index 000000000000..1c5d89620703 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/ConversationalSearchServiceStub.java @@ -0,0 +1,79 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub; + +import static com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient.ListConversationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.discoveryengine.v1alpha.Conversation; +import com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest; +import com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse; +import com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest; +import com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest; +import com.google.cloud.discoveryengine.v1alpha.GetConversationRequest; +import com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest; +import com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse; +import com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the ConversationalSearchService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class ConversationalSearchServiceStub implements BackgroundResource { + + public UnaryCallable + converseConversationCallable() { + throw new UnsupportedOperationException("Not implemented: converseConversationCallable()"); + } + + public UnaryCallable createConversationCallable() { + throw new UnsupportedOperationException("Not implemented: createConversationCallable()"); + } + + public UnaryCallable deleteConversationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteConversationCallable()"); + } + + public UnaryCallable updateConversationCallable() { + throw new UnsupportedOperationException("Not implemented: updateConversationCallable()"); + } + + public UnaryCallable getConversationCallable() { + throw new UnsupportedOperationException("Not implemented: getConversationCallable()"); + } + + public UnaryCallable + listConversationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listConversationsPagedCallable()"); + } + + public UnaryCallable + listConversationsCallable() { + throw new UnsupportedOperationException("Not implemented: listConversationsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/ConversationalSearchServiceStubSettings.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/ConversationalSearchServiceStubSettings.java new file mode 100644 index 000000000000..09186a35d10b --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/ConversationalSearchServiceStubSettings.java @@ -0,0 +1,543 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub; + +import static com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient.ListConversationsPagedResponse; + +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.discoveryengine.v1alpha.Conversation; +import com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest; +import com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse; +import com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest; +import com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest; +import com.google.cloud.discoveryengine.v1alpha.GetConversationRequest; +import com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest; +import com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse; +import com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest; +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 ConversationalSearchServiceStub}. + * + *

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

    + *
  • The default service address (discoveryengine.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 converseConversation to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ConversationalSearchServiceStubSettings.Builder conversationalSearchServiceSettingsBuilder =
+ *     ConversationalSearchServiceStubSettings.newBuilder();
+ * conversationalSearchServiceSettingsBuilder
+ *     .converseConversationSettings()
+ *     .setRetrySettings(
+ *         conversationalSearchServiceSettingsBuilder
+ *             .converseConversationSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ConversationalSearchServiceStubSettings conversationalSearchServiceSettings =
+ *     conversationalSearchServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ConversationalSearchServiceStubSettings + 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 + converseConversationSettings; + private final UnaryCallSettings + createConversationSettings; + private final UnaryCallSettings deleteConversationSettings; + private final UnaryCallSettings + updateConversationSettings; + private final UnaryCallSettings getConversationSettings; + private final PagedCallSettings< + ListConversationsRequest, ListConversationsResponse, ListConversationsPagedResponse> + listConversationsSettings; + + private static final PagedListDescriptor< + ListConversationsRequest, ListConversationsResponse, Conversation> + LIST_CONVERSATIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListConversationsRequest, ListConversationsResponse, Conversation>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListConversationsRequest injectToken( + ListConversationsRequest payload, String token) { + return ListConversationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListConversationsRequest injectPageSize( + ListConversationsRequest payload, int pageSize) { + return ListConversationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListConversationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListConversationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListConversationsResponse payload) { + return payload.getConversationsList() == null + ? ImmutableList.of() + : payload.getConversationsList(); + } + }; + + private static final PagedListResponseFactory< + ListConversationsRequest, ListConversationsResponse, ListConversationsPagedResponse> + LIST_CONVERSATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListConversationsRequest, + ListConversationsResponse, + ListConversationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListConversationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_CONVERSATIONS_PAGE_STR_DESC, request, context); + return ListConversationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to converseConversation. */ + public UnaryCallSettings + converseConversationSettings() { + return converseConversationSettings; + } + + /** Returns the object with the settings used for calls to createConversation. */ + public UnaryCallSettings createConversationSettings() { + return createConversationSettings; + } + + /** Returns the object with the settings used for calls to deleteConversation. */ + public UnaryCallSettings deleteConversationSettings() { + return deleteConversationSettings; + } + + /** Returns the object with the settings used for calls to updateConversation. */ + public UnaryCallSettings updateConversationSettings() { + return updateConversationSettings; + } + + /** Returns the object with the settings used for calls to getConversation. */ + public UnaryCallSettings getConversationSettings() { + return getConversationSettings; + } + + /** Returns the object with the settings used for calls to listConversations. */ + public PagedCallSettings< + ListConversationsRequest, ListConversationsResponse, ListConversationsPagedResponse> + listConversationsSettings() { + return listConversationsSettings; + } + + public ConversationalSearchServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcConversationalSearchServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonConversationalSearchServiceStub.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 "discoveryengine.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "discoveryengine.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ConversationalSearchServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ConversationalSearchServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ConversationalSearchServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ConversationalSearchServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + converseConversationSettings = settingsBuilder.converseConversationSettings().build(); + createConversationSettings = settingsBuilder.createConversationSettings().build(); + deleteConversationSettings = settingsBuilder.deleteConversationSettings().build(); + updateConversationSettings = settingsBuilder.updateConversationSettings().build(); + getConversationSettings = settingsBuilder.getConversationSettings().build(); + listConversationsSettings = settingsBuilder.listConversationsSettings().build(); + } + + /** Builder for ConversationalSearchServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder< + ConverseConversationRequest, ConverseConversationResponse> + converseConversationSettings; + private final UnaryCallSettings.Builder + createConversationSettings; + private final UnaryCallSettings.Builder + deleteConversationSettings; + private final UnaryCallSettings.Builder + updateConversationSettings; + private final UnaryCallSettings.Builder + getConversationSettings; + private final PagedCallSettings.Builder< + ListConversationsRequest, ListConversationsResponse, ListConversationsPagedResponse> + listConversationsSettings; + 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))); + 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(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(30000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(30000L)) + .setTotalTimeout(Duration.ofMillis(30000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + converseConversationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createConversationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteConversationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateConversationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getConversationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listConversationsSettings = PagedCallSettings.newBuilder(LIST_CONVERSATIONS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + converseConversationSettings, + createConversationSettings, + deleteConversationSettings, + updateConversationSettings, + getConversationSettings, + listConversationsSettings); + initDefaults(this); + } + + protected Builder(ConversationalSearchServiceStubSettings settings) { + super(settings); + + converseConversationSettings = settings.converseConversationSettings.toBuilder(); + createConversationSettings = settings.createConversationSettings.toBuilder(); + deleteConversationSettings = settings.deleteConversationSettings.toBuilder(); + updateConversationSettings = settings.updateConversationSettings.toBuilder(); + getConversationSettings = settings.getConversationSettings.toBuilder(); + listConversationsSettings = settings.listConversationsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + converseConversationSettings, + createConversationSettings, + deleteConversationSettings, + updateConversationSettings, + getConversationSettings, + listConversationsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .converseConversationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .createConversationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .deleteConversationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateConversationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getConversationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .listConversationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_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 converseConversation. */ + public UnaryCallSettings.Builder + converseConversationSettings() { + return converseConversationSettings; + } + + /** Returns the builder for the settings used for calls to createConversation. */ + public UnaryCallSettings.Builder + createConversationSettings() { + return createConversationSettings; + } + + /** Returns the builder for the settings used for calls to deleteConversation. */ + public UnaryCallSettings.Builder + deleteConversationSettings() { + return deleteConversationSettings; + } + + /** Returns the builder for the settings used for calls to updateConversation. */ + public UnaryCallSettings.Builder + updateConversationSettings() { + return updateConversationSettings; + } + + /** Returns the builder for the settings used for calls to getConversation. */ + public UnaryCallSettings.Builder + getConversationSettings() { + return getConversationSettings; + } + + /** Returns the builder for the settings used for calls to listConversations. */ + public PagedCallSettings.Builder< + ListConversationsRequest, ListConversationsResponse, ListConversationsPagedResponse> + listConversationsSettings() { + return listConversationsSettings; + } + + @Override + public ConversationalSearchServiceStubSettings build() throws IOException { + return new ConversationalSearchServiceStubSettings(this); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/DocumentServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/DocumentServiceStub.java new file mode 100644 index 000000000000..ff2de0513c05 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/DocumentServiceStub.java @@ -0,0 +1,106 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub; + +import static com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient.ListDocumentsPagedResponse; + +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.discoveryengine.v1alpha.CreateDocumentRequest; +import com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest; +import com.google.cloud.discoveryengine.v1alpha.Document; +import com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest; +import com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata; +import com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest; +import com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse; +import com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest; +import com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse; +import com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata; +import com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest; +import com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse; +import com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest; +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 DocumentService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class DocumentServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable getDocumentCallable() { + throw new UnsupportedOperationException("Not implemented: getDocumentCallable()"); + } + + public UnaryCallable + listDocumentsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listDocumentsPagedCallable()"); + } + + public UnaryCallable listDocumentsCallable() { + throw new UnsupportedOperationException("Not implemented: listDocumentsCallable()"); + } + + public UnaryCallable createDocumentCallable() { + throw new UnsupportedOperationException("Not implemented: createDocumentCallable()"); + } + + public UnaryCallable updateDocumentCallable() { + throw new UnsupportedOperationException("Not implemented: updateDocumentCallable()"); + } + + public UnaryCallable deleteDocumentCallable() { + throw new UnsupportedOperationException("Not implemented: deleteDocumentCallable()"); + } + + public OperationCallable + importDocumentsOperationCallable() { + throw new UnsupportedOperationException("Not implemented: importDocumentsOperationCallable()"); + } + + public UnaryCallable importDocumentsCallable() { + throw new UnsupportedOperationException("Not implemented: importDocumentsCallable()"); + } + + public OperationCallable + purgeDocumentsOperationCallable() { + throw new UnsupportedOperationException("Not implemented: purgeDocumentsOperationCallable()"); + } + + public UnaryCallable purgeDocumentsCallable() { + throw new UnsupportedOperationException("Not implemented: purgeDocumentsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/DocumentServiceStubSettings.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/DocumentServiceStubSettings.java new file mode 100644 index 000000000000..13c5df0060bb --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/DocumentServiceStubSettings.java @@ -0,0 +1,661 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub; + +import static com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient.ListDocumentsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest; +import com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest; +import com.google.cloud.discoveryengine.v1alpha.Document; +import com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest; +import com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata; +import com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest; +import com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse; +import com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest; +import com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse; +import com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata; +import com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest; +import com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse; +import com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest; +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 DocumentServiceStub}. + * + *

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

    + *
  • The default service address (discoveryengine.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 getDocument to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DocumentServiceStubSettings.Builder documentServiceSettingsBuilder =
+ *     DocumentServiceStubSettings.newBuilder();
+ * documentServiceSettingsBuilder
+ *     .getDocumentSettings()
+ *     .setRetrySettings(
+ *         documentServiceSettingsBuilder
+ *             .getDocumentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * DocumentServiceStubSettings documentServiceSettings = documentServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class DocumentServiceStubSettings 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 getDocumentSettings; + private final PagedCallSettings< + ListDocumentsRequest, ListDocumentsResponse, ListDocumentsPagedResponse> + listDocumentsSettings; + private final UnaryCallSettings createDocumentSettings; + private final UnaryCallSettings updateDocumentSettings; + private final UnaryCallSettings deleteDocumentSettings; + private final UnaryCallSettings importDocumentsSettings; + private final OperationCallSettings< + ImportDocumentsRequest, ImportDocumentsResponse, ImportDocumentsMetadata> + importDocumentsOperationSettings; + private final UnaryCallSettings purgeDocumentsSettings; + private final OperationCallSettings< + PurgeDocumentsRequest, PurgeDocumentsResponse, PurgeDocumentsMetadata> + purgeDocumentsOperationSettings; + + private static final PagedListDescriptor + LIST_DOCUMENTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListDocumentsRequest injectToken(ListDocumentsRequest payload, String token) { + return ListDocumentsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListDocumentsRequest injectPageSize(ListDocumentsRequest payload, int pageSize) { + return ListDocumentsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListDocumentsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListDocumentsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListDocumentsResponse payload) { + return payload.getDocumentsList() == null + ? ImmutableList.of() + : payload.getDocumentsList(); + } + }; + + private static final PagedListResponseFactory< + ListDocumentsRequest, ListDocumentsResponse, ListDocumentsPagedResponse> + LIST_DOCUMENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListDocumentsRequest, ListDocumentsResponse, ListDocumentsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListDocumentsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_DOCUMENTS_PAGE_STR_DESC, request, context); + return ListDocumentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to getDocument. */ + public UnaryCallSettings getDocumentSettings() { + return getDocumentSettings; + } + + /** Returns the object with the settings used for calls to listDocuments. */ + public PagedCallSettings + listDocumentsSettings() { + return listDocumentsSettings; + } + + /** Returns the object with the settings used for calls to createDocument. */ + public UnaryCallSettings createDocumentSettings() { + return createDocumentSettings; + } + + /** Returns the object with the settings used for calls to updateDocument. */ + public UnaryCallSettings updateDocumentSettings() { + return updateDocumentSettings; + } + + /** Returns the object with the settings used for calls to deleteDocument. */ + public UnaryCallSettings deleteDocumentSettings() { + return deleteDocumentSettings; + } + + /** Returns the object with the settings used for calls to importDocuments. */ + public UnaryCallSettings importDocumentsSettings() { + return importDocumentsSettings; + } + + /** Returns the object with the settings used for calls to importDocuments. */ + public OperationCallSettings< + ImportDocumentsRequest, ImportDocumentsResponse, ImportDocumentsMetadata> + importDocumentsOperationSettings() { + return importDocumentsOperationSettings; + } + + /** Returns the object with the settings used for calls to purgeDocuments. */ + public UnaryCallSettings purgeDocumentsSettings() { + return purgeDocumentsSettings; + } + + /** Returns the object with the settings used for calls to purgeDocuments. */ + public OperationCallSettings< + PurgeDocumentsRequest, PurgeDocumentsResponse, PurgeDocumentsMetadata> + purgeDocumentsOperationSettings() { + return purgeDocumentsOperationSettings; + } + + public DocumentServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcDocumentServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonDocumentServiceStub.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 "discoveryengine.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "discoveryengine.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(DocumentServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(DocumentServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DocumentServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected DocumentServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getDocumentSettings = settingsBuilder.getDocumentSettings().build(); + listDocumentsSettings = settingsBuilder.listDocumentsSettings().build(); + createDocumentSettings = settingsBuilder.createDocumentSettings().build(); + updateDocumentSettings = settingsBuilder.updateDocumentSettings().build(); + deleteDocumentSettings = settingsBuilder.deleteDocumentSettings().build(); + importDocumentsSettings = settingsBuilder.importDocumentsSettings().build(); + importDocumentsOperationSettings = settingsBuilder.importDocumentsOperationSettings().build(); + purgeDocumentsSettings = settingsBuilder.purgeDocumentsSettings().build(); + purgeDocumentsOperationSettings = settingsBuilder.purgeDocumentsOperationSettings().build(); + } + + /** Builder for DocumentServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder getDocumentSettings; + private final PagedCallSettings.Builder< + ListDocumentsRequest, ListDocumentsResponse, ListDocumentsPagedResponse> + listDocumentsSettings; + private final UnaryCallSettings.Builder createDocumentSettings; + private final UnaryCallSettings.Builder updateDocumentSettings; + private final UnaryCallSettings.Builder deleteDocumentSettings; + private final UnaryCallSettings.Builder + importDocumentsSettings; + private final OperationCallSettings.Builder< + ImportDocumentsRequest, ImportDocumentsResponse, ImportDocumentsMetadata> + importDocumentsOperationSettings; + private final UnaryCallSettings.Builder + purgeDocumentsSettings; + private final OperationCallSettings.Builder< + PurgeDocumentsRequest, PurgeDocumentsResponse, PurgeDocumentsMetadata> + purgeDocumentsOperationSettings; + 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))); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + 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(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .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(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(30000L)) + .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); + + getDocumentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listDocumentsSettings = PagedCallSettings.newBuilder(LIST_DOCUMENTS_PAGE_STR_FACT); + createDocumentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateDocumentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteDocumentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + importDocumentsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + importDocumentsOperationSettings = OperationCallSettings.newBuilder(); + purgeDocumentsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + purgeDocumentsOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getDocumentSettings, + listDocumentsSettings, + createDocumentSettings, + updateDocumentSettings, + deleteDocumentSettings, + importDocumentsSettings, + purgeDocumentsSettings); + initDefaults(this); + } + + protected Builder(DocumentServiceStubSettings settings) { + super(settings); + + getDocumentSettings = settings.getDocumentSettings.toBuilder(); + listDocumentsSettings = settings.listDocumentsSettings.toBuilder(); + createDocumentSettings = settings.createDocumentSettings.toBuilder(); + updateDocumentSettings = settings.updateDocumentSettings.toBuilder(); + deleteDocumentSettings = settings.deleteDocumentSettings.toBuilder(); + importDocumentsSettings = settings.importDocumentsSettings.toBuilder(); + importDocumentsOperationSettings = settings.importDocumentsOperationSettings.toBuilder(); + purgeDocumentsSettings = settings.purgeDocumentsSettings.toBuilder(); + purgeDocumentsOperationSettings = settings.purgeDocumentsOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getDocumentSettings, + listDocumentsSettings, + createDocumentSettings, + updateDocumentSettings, + deleteDocumentSettings, + importDocumentsSettings, + purgeDocumentsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getDocumentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .listDocumentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .createDocumentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateDocumentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .deleteDocumentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .importDocumentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + builder + .purgeDocumentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .importDocumentsOperationSettings() + .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(ImportDocumentsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(ImportDocumentsMetadata.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 + .purgeDocumentsOperationSettings() + .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(PurgeDocumentsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(PurgeDocumentsMetadata.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 getDocument. */ + public UnaryCallSettings.Builder getDocumentSettings() { + return getDocumentSettings; + } + + /** Returns the builder for the settings used for calls to listDocuments. */ + public PagedCallSettings.Builder< + ListDocumentsRequest, ListDocumentsResponse, ListDocumentsPagedResponse> + listDocumentsSettings() { + return listDocumentsSettings; + } + + /** Returns the builder for the settings used for calls to createDocument. */ + public UnaryCallSettings.Builder createDocumentSettings() { + return createDocumentSettings; + } + + /** Returns the builder for the settings used for calls to updateDocument. */ + public UnaryCallSettings.Builder updateDocumentSettings() { + return updateDocumentSettings; + } + + /** Returns the builder for the settings used for calls to deleteDocument. */ + public UnaryCallSettings.Builder deleteDocumentSettings() { + return deleteDocumentSettings; + } + + /** Returns the builder for the settings used for calls to importDocuments. */ + public UnaryCallSettings.Builder importDocumentsSettings() { + return importDocumentsSettings; + } + + /** Returns the builder for the settings used for calls to importDocuments. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + ImportDocumentsRequest, ImportDocumentsResponse, ImportDocumentsMetadata> + importDocumentsOperationSettings() { + return importDocumentsOperationSettings; + } + + /** Returns the builder for the settings used for calls to purgeDocuments. */ + public UnaryCallSettings.Builder purgeDocumentsSettings() { + return purgeDocumentsSettings; + } + + /** Returns the builder for the settings used for calls to purgeDocuments. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + PurgeDocumentsRequest, PurgeDocumentsResponse, PurgeDocumentsMetadata> + purgeDocumentsOperationSettings() { + return purgeDocumentsOperationSettings; + } + + @Override + public DocumentServiceStubSettings build() throws IOException { + return new DocumentServiceStubSettings(this); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcCompletionServiceCallableFactory.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcCompletionServiceCallableFactory.java new file mode 100644 index 000000000000..020b0b906da2 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcCompletionServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.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/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcCompletionServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcCompletionServiceStub.java new file mode 100644 index 000000000000..b065e19f9896 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcCompletionServiceStub.java @@ -0,0 +1,166 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest; +import com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse; +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.discoveryengine.v1alpha.CompletionService/CompleteQuery") + .setRequestMarshaller( + ProtoUtils.marshaller(CompleteQueryRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(CompleteQueryResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable completeQueryCallable; + + 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 -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("data_store", String.valueOf(request.getDataStore())); + return builder.build(); + }) + .build(); + + this.completeQueryCallable = + callableFactory.createUnaryCallable( + completeQueryTransportSettings, settings.completeQuerySettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable completeQueryCallable() { + return completeQueryCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcConversationalSearchServiceCallableFactory.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcConversationalSearchServiceCallableFactory.java new file mode 100644 index 000000000000..5d2327263815 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcConversationalSearchServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.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 ConversationalSearchService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcConversationalSearchServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcConversationalSearchServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcConversationalSearchServiceStub.java new file mode 100644 index 000000000000..94c2d0f55c9d --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcConversationalSearchServiceStub.java @@ -0,0 +1,360 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub; + +import static com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient.ListConversationsPagedResponse; + +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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.discoveryengine.v1alpha.Conversation; +import com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest; +import com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse; +import com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest; +import com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest; +import com.google.cloud.discoveryengine.v1alpha.GetConversationRequest; +import com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest; +import com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse; +import com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest; +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 ConversationalSearchService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcConversationalSearchServiceStub extends ConversationalSearchServiceStub { + private static final MethodDescriptor + converseConversationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.ConversationalSearchService/ConverseConversation") + .setRequestMarshaller( + ProtoUtils.marshaller(ConverseConversationRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ConverseConversationResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createConversationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.ConversationalSearchService/CreateConversation") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateConversationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Conversation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteConversationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.ConversationalSearchService/DeleteConversation") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteConversationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateConversationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.ConversationalSearchService/UpdateConversation") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateConversationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Conversation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getConversationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.ConversationalSearchService/GetConversation") + .setRequestMarshaller( + ProtoUtils.marshaller(GetConversationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Conversation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listConversationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.ConversationalSearchService/ListConversations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListConversationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListConversationsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable + converseConversationCallable; + private final UnaryCallable createConversationCallable; + private final UnaryCallable deleteConversationCallable; + private final UnaryCallable updateConversationCallable; + private final UnaryCallable getConversationCallable; + private final UnaryCallable + listConversationsCallable; + private final UnaryCallable + listConversationsPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcConversationalSearchServiceStub create( + ConversationalSearchServiceStubSettings settings) throws IOException { + return new GrpcConversationalSearchServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcConversationalSearchServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcConversationalSearchServiceStub( + ConversationalSearchServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcConversationalSearchServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcConversationalSearchServiceStub( + ConversationalSearchServiceStubSettings.newBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of GrpcConversationalSearchServiceStub, 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 GrpcConversationalSearchServiceStub( + ConversationalSearchServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcConversationalSearchServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcConversationalSearchServiceStub, 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 GrpcConversationalSearchServiceStub( + ConversationalSearchServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + converseConversationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(converseConversationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createConversationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createConversationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteConversationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteConversationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateConversationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateConversationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "conversation.name", String.valueOf(request.getConversation().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getConversationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getConversationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listConversationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listConversationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + + this.converseConversationCallable = + callableFactory.createUnaryCallable( + converseConversationTransportSettings, + settings.converseConversationSettings(), + clientContext); + this.createConversationCallable = + callableFactory.createUnaryCallable( + createConversationTransportSettings, + settings.createConversationSettings(), + clientContext); + this.deleteConversationCallable = + callableFactory.createUnaryCallable( + deleteConversationTransportSettings, + settings.deleteConversationSettings(), + clientContext); + this.updateConversationCallable = + callableFactory.createUnaryCallable( + updateConversationTransportSettings, + settings.updateConversationSettings(), + clientContext); + this.getConversationCallable = + callableFactory.createUnaryCallable( + getConversationTransportSettings, settings.getConversationSettings(), clientContext); + this.listConversationsCallable = + callableFactory.createUnaryCallable( + listConversationsTransportSettings, + settings.listConversationsSettings(), + clientContext); + this.listConversationsPagedCallable = + callableFactory.createPagedCallable( + listConversationsTransportSettings, + settings.listConversationsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable + converseConversationCallable() { + return converseConversationCallable; + } + + @Override + public UnaryCallable createConversationCallable() { + return createConversationCallable; + } + + @Override + public UnaryCallable deleteConversationCallable() { + return deleteConversationCallable; + } + + @Override + public UnaryCallable updateConversationCallable() { + return updateConversationCallable; + } + + @Override + public UnaryCallable getConversationCallable() { + return getConversationCallable; + } + + @Override + public UnaryCallable + listConversationsCallable() { + return listConversationsCallable; + } + + @Override + public UnaryCallable + listConversationsPagedCallable() { + return listConversationsPagedCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcDocumentServiceCallableFactory.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcDocumentServiceCallableFactory.java new file mode 100644 index 000000000000..1c718e1f76bc --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcDocumentServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.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 DocumentService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcDocumentServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcDocumentServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcDocumentServiceStub.java new file mode 100644 index 000000000000..22ff0ba42656 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcDocumentServiceStub.java @@ -0,0 +1,400 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub; + +import static com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient.ListDocumentsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest; +import com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest; +import com.google.cloud.discoveryengine.v1alpha.Document; +import com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest; +import com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata; +import com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest; +import com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse; +import com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest; +import com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse; +import com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata; +import com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest; +import com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse; +import com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest; +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 DocumentService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcDocumentServiceStub extends DocumentServiceStub { + private static final MethodDescriptor getDocumentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.discoveryengine.v1alpha.DocumentService/GetDocument") + .setRequestMarshaller(ProtoUtils.marshaller(GetDocumentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Document.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listDocumentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.DocumentService/ListDocuments") + .setRequestMarshaller( + ProtoUtils.marshaller(ListDocumentsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListDocumentsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createDocumentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.DocumentService/CreateDocument") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateDocumentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Document.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateDocumentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.DocumentService/UpdateDocument") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateDocumentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Document.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteDocumentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.DocumentService/DeleteDocument") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteDocumentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + importDocumentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.DocumentService/ImportDocuments") + .setRequestMarshaller( + ProtoUtils.marshaller(ImportDocumentsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + purgeDocumentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.DocumentService/PurgeDocuments") + .setRequestMarshaller( + ProtoUtils.marshaller(PurgeDocumentsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable getDocumentCallable; + private final UnaryCallable listDocumentsCallable; + private final UnaryCallable + listDocumentsPagedCallable; + private final UnaryCallable createDocumentCallable; + private final UnaryCallable updateDocumentCallable; + private final UnaryCallable deleteDocumentCallable; + private final UnaryCallable importDocumentsCallable; + private final OperationCallable< + ImportDocumentsRequest, ImportDocumentsResponse, ImportDocumentsMetadata> + importDocumentsOperationCallable; + private final UnaryCallable purgeDocumentsCallable; + private final OperationCallable< + PurgeDocumentsRequest, PurgeDocumentsResponse, PurgeDocumentsMetadata> + purgeDocumentsOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcDocumentServiceStub create(DocumentServiceStubSettings settings) + throws IOException { + return new GrpcDocumentServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcDocumentServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcDocumentServiceStub( + DocumentServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcDocumentServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcDocumentServiceStub( + DocumentServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcDocumentServiceStub, 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 GrpcDocumentServiceStub( + DocumentServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcDocumentServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcDocumentServiceStub, 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 GrpcDocumentServiceStub( + DocumentServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getDocumentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getDocumentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listDocumentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listDocumentsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings createDocumentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createDocumentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateDocumentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateDocumentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("document.name", String.valueOf(request.getDocument().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteDocumentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteDocumentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings importDocumentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(importDocumentsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings purgeDocumentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(purgeDocumentsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + + this.getDocumentCallable = + callableFactory.createUnaryCallable( + getDocumentTransportSettings, settings.getDocumentSettings(), clientContext); + this.listDocumentsCallable = + callableFactory.createUnaryCallable( + listDocumentsTransportSettings, settings.listDocumentsSettings(), clientContext); + this.listDocumentsPagedCallable = + callableFactory.createPagedCallable( + listDocumentsTransportSettings, settings.listDocumentsSettings(), clientContext); + this.createDocumentCallable = + callableFactory.createUnaryCallable( + createDocumentTransportSettings, settings.createDocumentSettings(), clientContext); + this.updateDocumentCallable = + callableFactory.createUnaryCallable( + updateDocumentTransportSettings, settings.updateDocumentSettings(), clientContext); + this.deleteDocumentCallable = + callableFactory.createUnaryCallable( + deleteDocumentTransportSettings, settings.deleteDocumentSettings(), clientContext); + this.importDocumentsCallable = + callableFactory.createUnaryCallable( + importDocumentsTransportSettings, settings.importDocumentsSettings(), clientContext); + this.importDocumentsOperationCallable = + callableFactory.createOperationCallable( + importDocumentsTransportSettings, + settings.importDocumentsOperationSettings(), + clientContext, + operationsStub); + this.purgeDocumentsCallable = + callableFactory.createUnaryCallable( + purgeDocumentsTransportSettings, settings.purgeDocumentsSettings(), clientContext); + this.purgeDocumentsOperationCallable = + callableFactory.createOperationCallable( + purgeDocumentsTransportSettings, + settings.purgeDocumentsOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getDocumentCallable() { + return getDocumentCallable; + } + + @Override + public UnaryCallable listDocumentsCallable() { + return listDocumentsCallable; + } + + @Override + public UnaryCallable + listDocumentsPagedCallable() { + return listDocumentsPagedCallable; + } + + @Override + public UnaryCallable createDocumentCallable() { + return createDocumentCallable; + } + + @Override + public UnaryCallable updateDocumentCallable() { + return updateDocumentCallable; + } + + @Override + public UnaryCallable deleteDocumentCallable() { + return deleteDocumentCallable; + } + + @Override + public UnaryCallable importDocumentsCallable() { + return importDocumentsCallable; + } + + @Override + public OperationCallable + importDocumentsOperationCallable() { + return importDocumentsOperationCallable; + } + + @Override + public UnaryCallable purgeDocumentsCallable() { + return purgeDocumentsCallable; + } + + @Override + public OperationCallable + purgeDocumentsOperationCallable() { + return purgeDocumentsOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcRecommendationServiceCallableFactory.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcRecommendationServiceCallableFactory.java new file mode 100644 index 000000000000..beae336b94b8 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcRecommendationServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.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 RecommendationService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcRecommendationServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcRecommendationServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcRecommendationServiceStub.java new file mode 100644 index 000000000000..efabaf4123cf --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcRecommendationServiceStub.java @@ -0,0 +1,164 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.discoveryengine.v1alpha.RecommendRequest; +import com.google.cloud.discoveryengine.v1alpha.RecommendResponse; +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 RecommendationService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcRecommendationServiceStub extends RecommendationServiceStub { + private static final MethodDescriptor + recommendMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.RecommendationService/Recommend") + .setRequestMarshaller(ProtoUtils.marshaller(RecommendRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RecommendResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable recommendCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcRecommendationServiceStub create( + RecommendationServiceStubSettings settings) throws IOException { + return new GrpcRecommendationServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcRecommendationServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcRecommendationServiceStub( + RecommendationServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcRecommendationServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcRecommendationServiceStub( + RecommendationServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcRecommendationServiceStub, 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 GrpcRecommendationServiceStub( + RecommendationServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcRecommendationServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcRecommendationServiceStub, 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 GrpcRecommendationServiceStub( + RecommendationServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings recommendTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(recommendMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("serving_config", String.valueOf(request.getServingConfig())); + return builder.build(); + }) + .build(); + + this.recommendCallable = + callableFactory.createUnaryCallable( + recommendTransportSettings, settings.recommendSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable recommendCallable() { + return recommendCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSchemaServiceCallableFactory.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSchemaServiceCallableFactory.java new file mode 100644 index 000000000000..04dcbe7649b1 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSchemaServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.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 SchemaService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSchemaServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSchemaServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSchemaServiceStub.java new file mode 100644 index 000000000000..39f3a563d410 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSchemaServiceStub.java @@ -0,0 +1,338 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub; + +import static com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient.ListSchemasPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata; +import com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest; +import com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata; +import com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest; +import com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest; +import com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest; +import com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse; +import com.google.cloud.discoveryengine.v1alpha.Schema; +import com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata; +import com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest; +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 SchemaService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSchemaServiceStub extends SchemaServiceStub { + private static final MethodDescriptor getSchemaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.discoveryengine.v1alpha.SchemaService/GetSchema") + .setRequestMarshaller(ProtoUtils.marshaller(GetSchemaRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Schema.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listSchemasMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.discoveryengine.v1alpha.SchemaService/ListSchemas") + .setRequestMarshaller(ProtoUtils.marshaller(ListSchemasRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListSchemasResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createSchemaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.discoveryengine.v1alpha.SchemaService/CreateSchema") + .setRequestMarshaller(ProtoUtils.marshaller(CreateSchemaRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateSchemaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.discoveryengine.v1alpha.SchemaService/UpdateSchema") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateSchemaRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteSchemaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.discoveryengine.v1alpha.SchemaService/DeleteSchema") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteSchemaRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable getSchemaCallable; + private final UnaryCallable listSchemasCallable; + private final UnaryCallable + listSchemasPagedCallable; + private final UnaryCallable createSchemaCallable; + private final OperationCallable + createSchemaOperationCallable; + private final UnaryCallable updateSchemaCallable; + private final OperationCallable + updateSchemaOperationCallable; + private final UnaryCallable deleteSchemaCallable; + private final OperationCallable + deleteSchemaOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSchemaServiceStub create(SchemaServiceStubSettings settings) + throws IOException { + return new GrpcSchemaServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSchemaServiceStub create(ClientContext clientContext) throws IOException { + return new GrpcSchemaServiceStub(SchemaServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSchemaServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSchemaServiceStub( + SchemaServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSchemaServiceStub, 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 GrpcSchemaServiceStub(SchemaServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcSchemaServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSchemaServiceStub, 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 GrpcSchemaServiceStub( + SchemaServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getSchemaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSchemaMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listSchemasTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSchemasMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings createSchemaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSchemaMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateSchemaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateSchemaMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("schema.name", String.valueOf(request.getSchema().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteSchemaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSchemaMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.getSchemaCallable = + callableFactory.createUnaryCallable( + getSchemaTransportSettings, settings.getSchemaSettings(), clientContext); + this.listSchemasCallable = + callableFactory.createUnaryCallable( + listSchemasTransportSettings, settings.listSchemasSettings(), clientContext); + this.listSchemasPagedCallable = + callableFactory.createPagedCallable( + listSchemasTransportSettings, settings.listSchemasSettings(), clientContext); + this.createSchemaCallable = + callableFactory.createUnaryCallable( + createSchemaTransportSettings, settings.createSchemaSettings(), clientContext); + this.createSchemaOperationCallable = + callableFactory.createOperationCallable( + createSchemaTransportSettings, + settings.createSchemaOperationSettings(), + clientContext, + operationsStub); + this.updateSchemaCallable = + callableFactory.createUnaryCallable( + updateSchemaTransportSettings, settings.updateSchemaSettings(), clientContext); + this.updateSchemaOperationCallable = + callableFactory.createOperationCallable( + updateSchemaTransportSettings, + settings.updateSchemaOperationSettings(), + clientContext, + operationsStub); + this.deleteSchemaCallable = + callableFactory.createUnaryCallable( + deleteSchemaTransportSettings, settings.deleteSchemaSettings(), clientContext); + this.deleteSchemaOperationCallable = + callableFactory.createOperationCallable( + deleteSchemaTransportSettings, + settings.deleteSchemaOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getSchemaCallable() { + return getSchemaCallable; + } + + @Override + public UnaryCallable listSchemasCallable() { + return listSchemasCallable; + } + + @Override + public UnaryCallable listSchemasPagedCallable() { + return listSchemasPagedCallable; + } + + @Override + public UnaryCallable createSchemaCallable() { + return createSchemaCallable; + } + + @Override + public OperationCallable + createSchemaOperationCallable() { + return createSchemaOperationCallable; + } + + @Override + public UnaryCallable updateSchemaCallable() { + return updateSchemaCallable; + } + + @Override + public OperationCallable + updateSchemaOperationCallable() { + return updateSchemaOperationCallable; + } + + @Override + public UnaryCallable deleteSchemaCallable() { + return deleteSchemaCallable; + } + + @Override + public OperationCallable + deleteSchemaOperationCallable() { + return deleteSchemaOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSearchServiceCallableFactory.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSearchServiceCallableFactory.java new file mode 100644 index 000000000000..313ce9d20149 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSearchServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.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/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSearchServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSearchServiceStub.java new file mode 100644 index 000000000000..e67789d8c522 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSearchServiceStub.java @@ -0,0 +1,171 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub; + +import static com.google.cloud.discoveryengine.v1alpha.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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.discoveryengine.v1alpha.SearchRequest; +import com.google.cloud.discoveryengine.v1alpha.SearchResponse; +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.discoveryengine.v1alpha.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 -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("serving_config", String.valueOf(request.getServingConfig())); + return builder.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/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSiteSearchEngineServiceCallableFactory.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSiteSearchEngineServiceCallableFactory.java new file mode 100644 index 000000000000..dfa3fbe9d4f2 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSiteSearchEngineServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.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 SiteSearchEngineService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSiteSearchEngineServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSiteSearchEngineServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSiteSearchEngineServiceStub.java new file mode 100644 index 000000000000..0f2dc004ab09 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcSiteSearchEngineServiceStub.java @@ -0,0 +1,181 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata; +import com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest; +import com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse; +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 SiteSearchEngineService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSiteSearchEngineServiceStub extends SiteSearchEngineServiceStub { + private static final MethodDescriptor recrawlUrisMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.SiteSearchEngineService/RecrawlUris") + .setRequestMarshaller(ProtoUtils.marshaller(RecrawlUrisRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable recrawlUrisCallable; + private final OperationCallable + recrawlUrisOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSiteSearchEngineServiceStub create( + SiteSearchEngineServiceStubSettings settings) throws IOException { + return new GrpcSiteSearchEngineServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSiteSearchEngineServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSiteSearchEngineServiceStub( + SiteSearchEngineServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSiteSearchEngineServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSiteSearchEngineServiceStub( + SiteSearchEngineServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSiteSearchEngineServiceStub, 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 GrpcSiteSearchEngineServiceStub( + SiteSearchEngineServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcSiteSearchEngineServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSiteSearchEngineServiceStub, 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 GrpcSiteSearchEngineServiceStub( + SiteSearchEngineServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings recrawlUrisTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(recrawlUrisMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("site_search_engine", String.valueOf(request.getSiteSearchEngine())); + return builder.build(); + }) + .build(); + + this.recrawlUrisCallable = + callableFactory.createUnaryCallable( + recrawlUrisTransportSettings, settings.recrawlUrisSettings(), clientContext); + this.recrawlUrisOperationCallable = + callableFactory.createOperationCallable( + recrawlUrisTransportSettings, + settings.recrawlUrisOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable recrawlUrisCallable() { + return recrawlUrisCallable; + } + + @Override + public OperationCallable + recrawlUrisOperationCallable() { + return recrawlUrisOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcUserEventServiceCallableFactory.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcUserEventServiceCallableFactory.java new file mode 100644 index 000000000000..0710a2d938e9 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcUserEventServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.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/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcUserEventServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcUserEventServiceStub.java new file mode 100644 index 000000000000..3f9e80585a89 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/GrpcUserEventServiceStub.java @@ -0,0 +1,296 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest; +import com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata; +import com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest; +import com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse; +import com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata; +import com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest; +import com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse; +import com.google.cloud.discoveryengine.v1alpha.UserEvent; +import com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest; +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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEventService/ImportUserEvents") + .setRequestMarshaller( + ProtoUtils.marshaller(ImportUserEventsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable writeUserEventCallable; + private final UnaryCallable collectUserEventCallable; + private final UnaryCallable purgeUserEventsCallable; + private final OperationCallable< + PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeUserEventsMetadata> + purgeUserEventsOperationCallable; + private final UnaryCallable importUserEventsCallable; + private final OperationCallable< + ImportUserEventsRequest, ImportUserEventsResponse, ImportUserEventsMetadata> + importUserEventsOperationCallable; + + 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 -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings collectUserEventTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(collectUserEventMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings purgeUserEventsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(purgeUserEventsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings importUserEventsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(importUserEventsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.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.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< + ImportUserEventsRequest, ImportUserEventsResponse, ImportUserEventsMetadata> + importUserEventsOperationCallable() { + return importUserEventsOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonCompletionServiceCallableFactory.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonCompletionServiceCallableFactory.java new file mode 100644 index 000000000000..911d0b88dc8d --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonCompletionServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the CompletionService service API. + * + *

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

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonCompletionServiceStub extends CompletionServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + completeQueryMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.CompletionService/CompleteQuery") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{dataStore=projects/*/locations/*/dataStores/*}:completeQuery", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "dataStore", request.getDataStore()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{dataStore=projects/*/locations/*/collections/*/dataStores/*}:completeQuery") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, + "includeTailSuggestions", + request.getIncludeTailSuggestions()); + serializer.putQueryParam(fields, "query", request.getQuery()); + serializer.putQueryParam(fields, "queryModel", request.getQueryModel()); + serializer.putQueryParam( + fields, "userPseudoId", request.getUserPseudoId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(CompleteQueryResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable completeQueryCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonCompletionServiceStub create(CompletionServiceStubSettings settings) + throws IOException { + return new HttpJsonCompletionServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonCompletionServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonCompletionServiceStub( + CompletionServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonCompletionServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonCompletionServiceStub( + CompletionServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonCompletionServiceStub, 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 HttpJsonCompletionServiceStub( + CompletionServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonCompletionServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonCompletionServiceStub, 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 HttpJsonCompletionServiceStub( + CompletionServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + completeQueryTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(completeQueryMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("data_store", String.valueOf(request.getDataStore())); + return builder.build(); + }) + .build(); + + this.completeQueryCallable = + callableFactory.createUnaryCallable( + completeQueryTransportSettings, settings.completeQuerySettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(completeQueryMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable completeQueryCallable() { + return completeQueryCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonConversationalSearchServiceCallableFactory.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonConversationalSearchServiceCallableFactory.java new file mode 100644 index 000000000000..3a1fd9834e7b --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonConversationalSearchServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the ConversationalSearchService service API. + * + *

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

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonConversationalSearchServiceStub extends ConversationalSearchServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor< + ConverseConversationRequest, ConverseConversationResponse> + converseConversationMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.ConversationalSearchService/ConverseConversation") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/conversations/*}:converse", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}:converse") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ConverseConversationResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createConversationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.ConversationalSearchService/CreateConversation") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*/dataStores/*}/conversations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*}/conversations") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("conversation", request.getConversation(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Conversation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteConversationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.ConversationalSearchService/DeleteConversation") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/conversations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateConversationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.ConversationalSearchService/UpdateConversation") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{conversation.name=projects/*/locations/*/dataStores/*/conversations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "conversation.name", request.getConversation().getName()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{conversation.name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("conversation", request.getConversation(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Conversation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getConversationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.ConversationalSearchService/GetConversation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/conversations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Conversation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listConversationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.ConversationalSearchService/ListConversations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*/dataStores/*}/conversations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*}/conversations") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListConversationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + converseConversationCallable; + private final UnaryCallable createConversationCallable; + private final UnaryCallable deleteConversationCallable; + private final UnaryCallable updateConversationCallable; + private final UnaryCallable getConversationCallable; + private final UnaryCallable + listConversationsCallable; + private final UnaryCallable + listConversationsPagedCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonConversationalSearchServiceStub create( + ConversationalSearchServiceStubSettings settings) throws IOException { + return new HttpJsonConversationalSearchServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonConversationalSearchServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonConversationalSearchServiceStub( + ConversationalSearchServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonConversationalSearchServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonConversationalSearchServiceStub( + ConversationalSearchServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonConversationalSearchServiceStub, 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 HttpJsonConversationalSearchServiceStub( + ConversationalSearchServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonConversationalSearchServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonConversationalSearchServiceStub, 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 HttpJsonConversationalSearchServiceStub( + ConversationalSearchServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + converseConversationTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(converseConversationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + createConversationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createConversationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteConversationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteConversationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + updateConversationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateConversationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "conversation.name", String.valueOf(request.getConversation().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getConversationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getConversationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listConversationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listConversationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + + this.converseConversationCallable = + callableFactory.createUnaryCallable( + converseConversationTransportSettings, + settings.converseConversationSettings(), + clientContext); + this.createConversationCallable = + callableFactory.createUnaryCallable( + createConversationTransportSettings, + settings.createConversationSettings(), + clientContext); + this.deleteConversationCallable = + callableFactory.createUnaryCallable( + deleteConversationTransportSettings, + settings.deleteConversationSettings(), + clientContext); + this.updateConversationCallable = + callableFactory.createUnaryCallable( + updateConversationTransportSettings, + settings.updateConversationSettings(), + clientContext); + this.getConversationCallable = + callableFactory.createUnaryCallable( + getConversationTransportSettings, settings.getConversationSettings(), clientContext); + this.listConversationsCallable = + callableFactory.createUnaryCallable( + listConversationsTransportSettings, + settings.listConversationsSettings(), + clientContext); + this.listConversationsPagedCallable = + callableFactory.createPagedCallable( + listConversationsTransportSettings, + settings.listConversationsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(converseConversationMethodDescriptor); + methodDescriptors.add(createConversationMethodDescriptor); + methodDescriptors.add(deleteConversationMethodDescriptor); + methodDescriptors.add(updateConversationMethodDescriptor); + methodDescriptors.add(getConversationMethodDescriptor); + methodDescriptors.add(listConversationsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable + converseConversationCallable() { + return converseConversationCallable; + } + + @Override + public UnaryCallable createConversationCallable() { + return createConversationCallable; + } + + @Override + public UnaryCallable deleteConversationCallable() { + return deleteConversationCallable; + } + + @Override + public UnaryCallable updateConversationCallable() { + return updateConversationCallable; + } + + @Override + public UnaryCallable getConversationCallable() { + return getConversationCallable; + } + + @Override + public UnaryCallable + listConversationsCallable() { + return listConversationsCallable; + } + + @Override + public UnaryCallable + listConversationsPagedCallable() { + return listConversationsPagedCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonDocumentServiceCallableFactory.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonDocumentServiceCallableFactory.java new file mode 100644 index 000000000000..9058b11951e0 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonDocumentServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the DocumentService service API. + * + *

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

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonDocumentServiceStub extends DocumentServiceStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(PurgeDocumentsMetadata.getDescriptor()) + .add(PurgeDocumentsResponse.getDescriptor()) + .add(ImportDocumentsResponse.getDescriptor()) + .add(ImportDocumentsMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + getDocumentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.discoveryengine.v1alpha.DocumentService/GetDocument") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Document.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listDocumentsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.DocumentService/ListDocuments") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListDocumentsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createDocumentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.DocumentService/CreateDocument") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "documentId", request.getDocumentId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("document", request.getDocument(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Document.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateDocumentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.DocumentService/UpdateDocument") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{document.name=projects/*/locations/*/dataStores/*/branches/*/documents/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "document.name", request.getDocument().getName()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{document.name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("document", request.getDocument(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Document.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteDocumentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.DocumentService/DeleteDocument") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + importDocumentsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.DocumentService/ImportDocuments") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:import", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:import") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (ImportDocumentsRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + purgeDocumentsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.DocumentService/PurgeDocuments") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:purge", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:purge") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (PurgeDocumentsRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private final UnaryCallable getDocumentCallable; + private final UnaryCallable listDocumentsCallable; + private final UnaryCallable + listDocumentsPagedCallable; + private final UnaryCallable createDocumentCallable; + private final UnaryCallable updateDocumentCallable; + private final UnaryCallable deleteDocumentCallable; + private final UnaryCallable importDocumentsCallable; + private final OperationCallable< + ImportDocumentsRequest, ImportDocumentsResponse, ImportDocumentsMetadata> + importDocumentsOperationCallable; + private final UnaryCallable purgeDocumentsCallable; + private final OperationCallable< + PurgeDocumentsRequest, PurgeDocumentsResponse, PurgeDocumentsMetadata> + purgeDocumentsOperationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonDocumentServiceStub create(DocumentServiceStubSettings settings) + throws IOException { + return new HttpJsonDocumentServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonDocumentServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonDocumentServiceStub( + DocumentServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonDocumentServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonDocumentServiceStub( + DocumentServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonDocumentServiceStub, 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 HttpJsonDocumentServiceStub( + DocumentServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonDocumentServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonDocumentServiceStub, 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 HttpJsonDocumentServiceStub( + DocumentServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}") + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1alpha/{name=projects/*/locations/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1alpha/{name=projects/*/operations/*}") + .build()) + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations") + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/engines/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1alpha/{name=projects/*/locations/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1alpha/{name=projects/*}/operations") + .build()) + .build()) + .build()); + + HttpJsonCallSettings getDocumentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getDocumentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listDocumentsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listDocumentsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings createDocumentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createDocumentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateDocumentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateDocumentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("document.name", String.valueOf(request.getDocument().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteDocumentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteDocumentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings importDocumentsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(importDocumentsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings purgeDocumentsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(purgeDocumentsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + + this.getDocumentCallable = + callableFactory.createUnaryCallable( + getDocumentTransportSettings, settings.getDocumentSettings(), clientContext); + this.listDocumentsCallable = + callableFactory.createUnaryCallable( + listDocumentsTransportSettings, settings.listDocumentsSettings(), clientContext); + this.listDocumentsPagedCallable = + callableFactory.createPagedCallable( + listDocumentsTransportSettings, settings.listDocumentsSettings(), clientContext); + this.createDocumentCallable = + callableFactory.createUnaryCallable( + createDocumentTransportSettings, settings.createDocumentSettings(), clientContext); + this.updateDocumentCallable = + callableFactory.createUnaryCallable( + updateDocumentTransportSettings, settings.updateDocumentSettings(), clientContext); + this.deleteDocumentCallable = + callableFactory.createUnaryCallable( + deleteDocumentTransportSettings, settings.deleteDocumentSettings(), clientContext); + this.importDocumentsCallable = + callableFactory.createUnaryCallable( + importDocumentsTransportSettings, settings.importDocumentsSettings(), clientContext); + this.importDocumentsOperationCallable = + callableFactory.createOperationCallable( + importDocumentsTransportSettings, + settings.importDocumentsOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.purgeDocumentsCallable = + callableFactory.createUnaryCallable( + purgeDocumentsTransportSettings, settings.purgeDocumentsSettings(), clientContext); + this.purgeDocumentsOperationCallable = + callableFactory.createOperationCallable( + purgeDocumentsTransportSettings, + settings.purgeDocumentsOperationSettings(), + clientContext, + httpJsonOperationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(getDocumentMethodDescriptor); + methodDescriptors.add(listDocumentsMethodDescriptor); + methodDescriptors.add(createDocumentMethodDescriptor); + methodDescriptors.add(updateDocumentMethodDescriptor); + methodDescriptors.add(deleteDocumentMethodDescriptor); + methodDescriptors.add(importDocumentsMethodDescriptor); + methodDescriptors.add(purgeDocumentsMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable getDocumentCallable() { + return getDocumentCallable; + } + + @Override + public UnaryCallable listDocumentsCallable() { + return listDocumentsCallable; + } + + @Override + public UnaryCallable + listDocumentsPagedCallable() { + return listDocumentsPagedCallable; + } + + @Override + public UnaryCallable createDocumentCallable() { + return createDocumentCallable; + } + + @Override + public UnaryCallable updateDocumentCallable() { + return updateDocumentCallable; + } + + @Override + public UnaryCallable deleteDocumentCallable() { + return deleteDocumentCallable; + } + + @Override + public UnaryCallable importDocumentsCallable() { + return importDocumentsCallable; + } + + @Override + public OperationCallable + importDocumentsOperationCallable() { + return importDocumentsOperationCallable; + } + + @Override + public UnaryCallable purgeDocumentsCallable() { + return purgeDocumentsCallable; + } + + @Override + public OperationCallable + purgeDocumentsOperationCallable() { + return purgeDocumentsOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonRecommendationServiceCallableFactory.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonRecommendationServiceCallableFactory.java new file mode 100644 index 000000000000..6b91badbfbb5 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonRecommendationServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the RecommendationService service API. + * + *

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

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonRecommendationServiceStub extends RecommendationServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + recommendMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.RecommendationService/Recommend") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{servingConfig=projects/*/locations/*/dataStores/*/servingConfigs/*}:recommend", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "servingConfig", request.getServingConfig()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{servingConfig=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:recommend", + "/v1alpha/{servingConfig=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:recommend") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", request.toBuilder().clearServingConfig().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RecommendResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable recommendCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonRecommendationServiceStub create( + RecommendationServiceStubSettings settings) throws IOException { + return new HttpJsonRecommendationServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonRecommendationServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonRecommendationServiceStub( + RecommendationServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonRecommendationServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRecommendationServiceStub( + RecommendationServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonRecommendationServiceStub, 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 HttpJsonRecommendationServiceStub( + RecommendationServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonRecommendationServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonRecommendationServiceStub, 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 HttpJsonRecommendationServiceStub( + RecommendationServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings recommendTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(recommendMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("serving_config", String.valueOf(request.getServingConfig())); + return builder.build(); + }) + .build(); + + this.recommendCallable = + callableFactory.createUnaryCallable( + recommendTransportSettings, settings.recommendSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(recommendMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable recommendCallable() { + return recommendCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonSchemaServiceCallableFactory.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonSchemaServiceCallableFactory.java new file mode 100644 index 000000000000..2f6f25e0c6a0 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonSchemaServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SchemaService service API. + * + *

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

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSchemaServiceStub extends SchemaServiceStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Schema.getDescriptor()) + .add(Empty.getDescriptor()) + .add(UpdateSchemaMetadata.getDescriptor()) + .add(DeleteSchemaMetadata.getDescriptor()) + .add(CreateSchemaMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor getSchemaMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.discoveryengine.v1alpha.SchemaService/GetSchema") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/schemas/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Schema.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listSchemasMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.discoveryengine.v1alpha.SchemaService/ListSchemas") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*/dataStores/*}/schemas", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*}/schemas") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListSchemasResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createSchemaMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.discoveryengine.v1alpha.SchemaService/CreateSchema") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*/dataStores/*}/schemas", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*}/schemas") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "schemaId", request.getSchemaId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("schema", request.getSchema(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateSchemaRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateSchemaMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.discoveryengine.v1alpha.SchemaService/UpdateSchema") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{schema.name=projects/*/locations/*/dataStores/*/schemas/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "schema.name", request.getSchema().getName()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{schema.name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("schema", request.getSchema(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateSchemaRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteSchemaMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.discoveryengine.v1alpha.SchemaService/DeleteSchema") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/schemas/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteSchemaRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private final UnaryCallable getSchemaCallable; + private final UnaryCallable listSchemasCallable; + private final UnaryCallable + listSchemasPagedCallable; + private final UnaryCallable createSchemaCallable; + private final OperationCallable + createSchemaOperationCallable; + private final UnaryCallable updateSchemaCallable; + private final OperationCallable + updateSchemaOperationCallable; + private final UnaryCallable deleteSchemaCallable; + private final OperationCallable + deleteSchemaOperationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonSchemaServiceStub create(SchemaServiceStubSettings settings) + throws IOException { + return new HttpJsonSchemaServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSchemaServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSchemaServiceStub( + SchemaServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSchemaServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSchemaServiceStub( + SchemaServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSchemaServiceStub, 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 HttpJsonSchemaServiceStub( + SchemaServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSchemaServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSchemaServiceStub, 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 HttpJsonSchemaServiceStub( + SchemaServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}") + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1alpha/{name=projects/*/locations/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1alpha/{name=projects/*/operations/*}") + .build()) + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations") + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/engines/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1alpha/{name=projects/*/locations/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1alpha/{name=projects/*}/operations") + .build()) + .build()) + .build()); + + HttpJsonCallSettings getSchemaTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSchemaMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listSchemasTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listSchemasMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings createSchemaTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSchemaMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateSchemaTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateSchemaMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("schema.name", String.valueOf(request.getSchema().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteSchemaTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteSchemaMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.getSchemaCallable = + callableFactory.createUnaryCallable( + getSchemaTransportSettings, settings.getSchemaSettings(), clientContext); + this.listSchemasCallable = + callableFactory.createUnaryCallable( + listSchemasTransportSettings, settings.listSchemasSettings(), clientContext); + this.listSchemasPagedCallable = + callableFactory.createPagedCallable( + listSchemasTransportSettings, settings.listSchemasSettings(), clientContext); + this.createSchemaCallable = + callableFactory.createUnaryCallable( + createSchemaTransportSettings, settings.createSchemaSettings(), clientContext); + this.createSchemaOperationCallable = + callableFactory.createOperationCallable( + createSchemaTransportSettings, + settings.createSchemaOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateSchemaCallable = + callableFactory.createUnaryCallable( + updateSchemaTransportSettings, settings.updateSchemaSettings(), clientContext); + this.updateSchemaOperationCallable = + callableFactory.createOperationCallable( + updateSchemaTransportSettings, + settings.updateSchemaOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteSchemaCallable = + callableFactory.createUnaryCallable( + deleteSchemaTransportSettings, settings.deleteSchemaSettings(), clientContext); + this.deleteSchemaOperationCallable = + callableFactory.createOperationCallable( + deleteSchemaTransportSettings, + settings.deleteSchemaOperationSettings(), + clientContext, + httpJsonOperationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(getSchemaMethodDescriptor); + methodDescriptors.add(listSchemasMethodDescriptor); + methodDescriptors.add(createSchemaMethodDescriptor); + methodDescriptors.add(updateSchemaMethodDescriptor); + methodDescriptors.add(deleteSchemaMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable getSchemaCallable() { + return getSchemaCallable; + } + + @Override + public UnaryCallable listSchemasCallable() { + return listSchemasCallable; + } + + @Override + public UnaryCallable listSchemasPagedCallable() { + return listSchemasPagedCallable; + } + + @Override + public UnaryCallable createSchemaCallable() { + return createSchemaCallable; + } + + @Override + public OperationCallable + createSchemaOperationCallable() { + return createSchemaOperationCallable; + } + + @Override + public UnaryCallable updateSchemaCallable() { + return updateSchemaCallable; + } + + @Override + public OperationCallable + updateSchemaOperationCallable() { + return updateSchemaOperationCallable; + } + + @Override + public UnaryCallable deleteSchemaCallable() { + return deleteSchemaCallable; + } + + @Override + public OperationCallable + deleteSchemaOperationCallable() { + return deleteSchemaOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonSearchServiceCallableFactory.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonSearchServiceCallableFactory.java new file mode 100644 index 000000000000..f6502a58163c --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonSearchServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SearchService service API. + * + *

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

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSearchServiceStub extends SearchServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor searchMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.discoveryengine.v1alpha.SearchService/Search") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{servingConfig=projects/*/locations/*/dataStores/*/servingConfigs/*}:search", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "servingConfig", request.getServingConfig()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{servingConfig=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:search", + "/v1alpha/{servingConfig=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:search") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearServingConfig().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SearchResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable searchCallable; + private final UnaryCallable searchPagedCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonSearchServiceStub create(SearchServiceStubSettings settings) + throws IOException { + return new HttpJsonSearchServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSearchServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSearchServiceStub( + SearchServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSearchServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSearchServiceStub( + SearchServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSearchServiceStub, 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 HttpJsonSearchServiceStub( + SearchServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSearchServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSearchServiceStub, 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 HttpJsonSearchServiceStub( + SearchServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings searchTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(searchMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("serving_config", String.valueOf(request.getServingConfig())); + return builder.build(); + }) + .build(); + + this.searchCallable = + callableFactory.createUnaryCallable( + searchTransportSettings, settings.searchSettings(), clientContext); + this.searchPagedCallable = + callableFactory.createPagedCallable( + searchTransportSettings, settings.searchSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(searchMethodDescriptor); + return methodDescriptors; + } + + @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/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonSiteSearchEngineServiceCallableFactory.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonSiteSearchEngineServiceCallableFactory.java new file mode 100644 index 000000000000..4c7407be8088 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonSiteSearchEngineServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SiteSearchEngineService service API. + * + *

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

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSiteSearchEngineServiceStub extends SiteSearchEngineServiceStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(RecrawlUrisResponse.getDescriptor()) + .add(RecrawlUrisMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + recrawlUrisMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.SiteSearchEngineService/RecrawlUris") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{siteSearchEngine=projects/*/locations/*/dataStores/*/siteSearchEngine}:recrawlUris", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "siteSearchEngine", request.getSiteSearchEngine()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{siteSearchEngine=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}:recrawlUris") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", + request.toBuilder().clearSiteSearchEngine().build(), + true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (RecrawlUrisRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private final UnaryCallable recrawlUrisCallable; + private final OperationCallable + recrawlUrisOperationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonSiteSearchEngineServiceStub create( + SiteSearchEngineServiceStubSettings settings) throws IOException { + return new HttpJsonSiteSearchEngineServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSiteSearchEngineServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSiteSearchEngineServiceStub( + SiteSearchEngineServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSiteSearchEngineServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSiteSearchEngineServiceStub( + SiteSearchEngineServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonSiteSearchEngineServiceStub, 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 HttpJsonSiteSearchEngineServiceStub( + SiteSearchEngineServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonSiteSearchEngineServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSiteSearchEngineServiceStub, 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 HttpJsonSiteSearchEngineServiceStub( + SiteSearchEngineServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}") + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1alpha/{name=projects/*/locations/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1alpha/{name=projects/*/operations/*}") + .build()) + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations") + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/engines/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1alpha/{name=projects/*/locations/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1alpha/{name=projects/*}/operations") + .build()) + .build()) + .build()); + + HttpJsonCallSettings recrawlUrisTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(recrawlUrisMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("site_search_engine", String.valueOf(request.getSiteSearchEngine())); + return builder.build(); + }) + .build(); + + this.recrawlUrisCallable = + callableFactory.createUnaryCallable( + recrawlUrisTransportSettings, settings.recrawlUrisSettings(), clientContext); + this.recrawlUrisOperationCallable = + callableFactory.createOperationCallable( + recrawlUrisTransportSettings, + settings.recrawlUrisOperationSettings(), + clientContext, + httpJsonOperationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(recrawlUrisMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable recrawlUrisCallable() { + return recrawlUrisCallable; + } + + @Override + public OperationCallable + recrawlUrisOperationCallable() { + return recrawlUrisOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonUserEventServiceCallableFactory.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonUserEventServiceCallableFactory.java new file mode 100644 index 000000000000..cf9fb0fbb6f8 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/HttpJsonUserEventServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the UserEventService service API. + * + *

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

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonUserEventServiceStub extends UserEventServiceStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(ImportUserEventsResponse.getDescriptor()) + .add(PurgeUserEventsResponse.getDescriptor()) + .add(PurgeUserEventsMetadata.getDescriptor()) + .add(ImportUserEventsMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + writeUserEventMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.UserEventService/WriteUserEvent") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*/dataStores/*}/userEvents:write", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:write") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("userEvent", request.getUserEvent(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(UserEvent.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + collectUserEventMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.UserEventService/CollectUserEvent") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*/dataStores/*}/userEvents:collect", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:collect") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + if (request.hasEts()) { + serializer.putQueryParam(fields, "ets", request.getEts()); + } + if (request.hasUri()) { + serializer.putQueryParam(fields, "uri", request.getUri()); + } + serializer.putQueryParam(fields, "userEvent", request.getUserEvent()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(HttpBody.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + purgeUserEventsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.UserEventService/PurgeUserEvents") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*/dataStores/*}/userEvents:purge", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:purge") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (PurgeUserEventsRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + importUserEventsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.discoveryengine.v1alpha.UserEventService/ImportUserEvents") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*/locations/*/dataStores/*}/userEvents:import", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths( + "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:import") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (ImportUserEventsRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private final UnaryCallable writeUserEventCallable; + private final UnaryCallable collectUserEventCallable; + private final UnaryCallable purgeUserEventsCallable; + private final OperationCallable< + PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeUserEventsMetadata> + purgeUserEventsOperationCallable; + private final UnaryCallable importUserEventsCallable; + private final OperationCallable< + ImportUserEventsRequest, ImportUserEventsResponse, ImportUserEventsMetadata> + importUserEventsOperationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonUserEventServiceStub create(UserEventServiceStubSettings settings) + throws IOException { + return new HttpJsonUserEventServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonUserEventServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonUserEventServiceStub( + UserEventServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonUserEventServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonUserEventServiceStub( + UserEventServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonUserEventServiceStub, 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 HttpJsonUserEventServiceStub( + UserEventServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonUserEventServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonUserEventServiceStub, 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 HttpJsonUserEventServiceStub( + UserEventServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}") + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1alpha/{name=projects/*/locations/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1alpha/{name=projects/*/operations/*}") + .build()) + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations") + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*/engines/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/collections/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*/models/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1alpha/{name=projects/*/locations/*/dataStores/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1alpha/{name=projects/*/locations/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v1alpha/{name=projects/*}/operations") + .build()) + .build()) + .build()); + + HttpJsonCallSettings writeUserEventTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(writeUserEventMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings collectUserEventTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(collectUserEventMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings purgeUserEventsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(purgeUserEventsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings importUserEventsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(importUserEventsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.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, + httpJsonOperationsStub); + this.importUserEventsCallable = + callableFactory.createUnaryCallable( + importUserEventsTransportSettings, settings.importUserEventsSettings(), clientContext); + this.importUserEventsOperationCallable = + callableFactory.createOperationCallable( + importUserEventsTransportSettings, + settings.importUserEventsOperationSettings(), + clientContext, + httpJsonOperationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(writeUserEventMethodDescriptor); + methodDescriptors.add(collectUserEventMethodDescriptor); + methodDescriptors.add(purgeUserEventsMethodDescriptor); + methodDescriptors.add(importUserEventsMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @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< + ImportUserEventsRequest, ImportUserEventsResponse, ImportUserEventsMetadata> + importUserEventsOperationCallable() { + return importUserEventsOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/RecommendationServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/RecommendationServiceStub.java new file mode 100644 index 000000000000..076005630ef0 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/RecommendationServiceStub.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.RecommendRequest; +import com.google.cloud.discoveryengine.v1alpha.RecommendResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the RecommendationService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class RecommendationServiceStub implements BackgroundResource { + + public UnaryCallable recommendCallable() { + throw new UnsupportedOperationException("Not implemented: recommendCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/RecommendationServiceStubSettings.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/RecommendationServiceStubSettings.java new file mode 100644 index 000000000000..6fe86c730d71 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/RecommendationServiceStubSettings.java @@ -0,0 +1,330 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.discoveryengine.v1alpha.RecommendRequest; +import com.google.cloud.discoveryengine.v1alpha.RecommendResponse; +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 RecommendationServiceStub}. + * + *

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

    + *
  • The default service address (discoveryengine.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 recommend to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RecommendationServiceStubSettings.Builder recommendationServiceSettingsBuilder =
+ *     RecommendationServiceStubSettings.newBuilder();
+ * recommendationServiceSettingsBuilder
+ *     .recommendSettings()
+ *     .setRetrySettings(
+ *         recommendationServiceSettingsBuilder
+ *             .recommendSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * RecommendationServiceStubSettings recommendationServiceSettings =
+ *     recommendationServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class RecommendationServiceStubSettings + 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 recommendSettings; + + /** Returns the object with the settings used for calls to recommend. */ + public UnaryCallSettings recommendSettings() { + return recommendSettings; + } + + public RecommendationServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcRecommendationServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonRecommendationServiceStub.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 "discoveryengine.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "discoveryengine.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(RecommendationServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(RecommendationServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RecommendationServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RecommendationServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + recommendSettings = settingsBuilder.recommendSettings().build(); + } + + /** Builder for RecommendationServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder recommendSettings; + 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))); + 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); + + recommendSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(recommendSettings); + initDefaults(this); + } + + protected Builder(RecommendationServiceStubSettings settings) { + super(settings); + + recommendSettings = settings.recommendSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(recommendSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .recommendSettings() + .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 recommend. */ + public UnaryCallSettings.Builder recommendSettings() { + return recommendSettings; + } + + @Override + public RecommendationServiceStubSettings build() throws IOException { + return new RecommendationServiceStubSettings(this); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SchemaServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SchemaServiceStub.java new file mode 100644 index 000000000000..816101945e8f --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SchemaServiceStub.java @@ -0,0 +1,99 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub; + +import static com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient.ListSchemasPagedResponse; + +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.discoveryengine.v1alpha.CreateSchemaMetadata; +import com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest; +import com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata; +import com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest; +import com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest; +import com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest; +import com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse; +import com.google.cloud.discoveryengine.v1alpha.Schema; +import com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata; +import com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest; +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 SchemaService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class SchemaServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable getSchemaCallable() { + throw new UnsupportedOperationException("Not implemented: getSchemaCallable()"); + } + + public UnaryCallable listSchemasPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSchemasPagedCallable()"); + } + + public UnaryCallable listSchemasCallable() { + throw new UnsupportedOperationException("Not implemented: listSchemasCallable()"); + } + + public OperationCallable + createSchemaOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createSchemaOperationCallable()"); + } + + public UnaryCallable createSchemaCallable() { + throw new UnsupportedOperationException("Not implemented: createSchemaCallable()"); + } + + public OperationCallable + updateSchemaOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateSchemaOperationCallable()"); + } + + public UnaryCallable updateSchemaCallable() { + throw new UnsupportedOperationException("Not implemented: updateSchemaCallable()"); + } + + public OperationCallable + deleteSchemaOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSchemaOperationCallable()"); + } + + public UnaryCallable deleteSchemaCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSchemaCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SchemaServiceStubSettings.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SchemaServiceStubSettings.java new file mode 100644 index 000000000000..ebae00c56240 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SchemaServiceStubSettings.java @@ -0,0 +1,634 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub; + +import static com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient.ListSchemasPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata; +import com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest; +import com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata; +import com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest; +import com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest; +import com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest; +import com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse; +import com.google.cloud.discoveryengine.v1alpha.Schema; +import com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata; +import com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest; +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 SchemaServiceStub}. + * + *

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

    + *
  • The default service address (discoveryengine.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 getSchema to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SchemaServiceStubSettings.Builder schemaServiceSettingsBuilder =
+ *     SchemaServiceStubSettings.newBuilder();
+ * schemaServiceSettingsBuilder
+ *     .getSchemaSettings()
+ *     .setRetrySettings(
+ *         schemaServiceSettingsBuilder
+ *             .getSchemaSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SchemaServiceStubSettings schemaServiceSettings = schemaServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class SchemaServiceStubSettings 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 getSchemaSettings; + private final PagedCallSettings + listSchemasSettings; + private final UnaryCallSettings createSchemaSettings; + private final OperationCallSettings + createSchemaOperationSettings; + private final UnaryCallSettings updateSchemaSettings; + private final OperationCallSettings + updateSchemaOperationSettings; + private final UnaryCallSettings deleteSchemaSettings; + private final OperationCallSettings + deleteSchemaOperationSettings; + + private static final PagedListDescriptor + LIST_SCHEMAS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSchemasRequest injectToken(ListSchemasRequest payload, String token) { + return ListSchemasRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSchemasRequest injectPageSize(ListSchemasRequest payload, int pageSize) { + return ListSchemasRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSchemasRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSchemasResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSchemasResponse payload) { + return payload.getSchemasList() == null + ? ImmutableList.of() + : payload.getSchemasList(); + } + }; + + private static final PagedListResponseFactory< + ListSchemasRequest, ListSchemasResponse, ListSchemasPagedResponse> + LIST_SCHEMAS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSchemasRequest, ListSchemasResponse, ListSchemasPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSchemasRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SCHEMAS_PAGE_STR_DESC, request, context); + return ListSchemasPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to getSchema. */ + public UnaryCallSettings getSchemaSettings() { + return getSchemaSettings; + } + + /** Returns the object with the settings used for calls to listSchemas. */ + public PagedCallSettings + listSchemasSettings() { + return listSchemasSettings; + } + + /** Returns the object with the settings used for calls to createSchema. */ + public UnaryCallSettings createSchemaSettings() { + return createSchemaSettings; + } + + /** Returns the object with the settings used for calls to createSchema. */ + public OperationCallSettings + createSchemaOperationSettings() { + return createSchemaOperationSettings; + } + + /** Returns the object with the settings used for calls to updateSchema. */ + public UnaryCallSettings updateSchemaSettings() { + return updateSchemaSettings; + } + + /** Returns the object with the settings used for calls to updateSchema. */ + public OperationCallSettings + updateSchemaOperationSettings() { + return updateSchemaOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteSchema. */ + public UnaryCallSettings deleteSchemaSettings() { + return deleteSchemaSettings; + } + + /** Returns the object with the settings used for calls to deleteSchema. */ + public OperationCallSettings + deleteSchemaOperationSettings() { + return deleteSchemaOperationSettings; + } + + public SchemaServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSchemaServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSchemaServiceStub.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 "discoveryengine.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "discoveryengine.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SchemaServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SchemaServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SchemaServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SchemaServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getSchemaSettings = settingsBuilder.getSchemaSettings().build(); + listSchemasSettings = settingsBuilder.listSchemasSettings().build(); + createSchemaSettings = settingsBuilder.createSchemaSettings().build(); + createSchemaOperationSettings = settingsBuilder.createSchemaOperationSettings().build(); + updateSchemaSettings = settingsBuilder.updateSchemaSettings().build(); + updateSchemaOperationSettings = settingsBuilder.updateSchemaOperationSettings().build(); + deleteSchemaSettings = settingsBuilder.deleteSchemaSettings().build(); + deleteSchemaOperationSettings = settingsBuilder.deleteSchemaOperationSettings().build(); + } + + /** Builder for SchemaServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder getSchemaSettings; + private final PagedCallSettings.Builder< + ListSchemasRequest, ListSchemasResponse, ListSchemasPagedResponse> + listSchemasSettings; + private final UnaryCallSettings.Builder createSchemaSettings; + private final OperationCallSettings.Builder + createSchemaOperationSettings; + private final UnaryCallSettings.Builder updateSchemaSettings; + private final OperationCallSettings.Builder + updateSchemaOperationSettings; + private final UnaryCallSettings.Builder deleteSchemaSettings; + private final OperationCallSettings.Builder + deleteSchemaOperationSettings; + 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))); + 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(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(30000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(30000L)) + .setTotalTimeout(Duration.ofMillis(30000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSchemasSettings = PagedCallSettings.newBuilder(LIST_SCHEMAS_PAGE_STR_FACT); + createSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createSchemaOperationSettings = OperationCallSettings.newBuilder(); + updateSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateSchemaOperationSettings = OperationCallSettings.newBuilder(); + deleteSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteSchemaOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getSchemaSettings, + listSchemasSettings, + createSchemaSettings, + updateSchemaSettings, + deleteSchemaSettings); + initDefaults(this); + } + + protected Builder(SchemaServiceStubSettings settings) { + super(settings); + + getSchemaSettings = settings.getSchemaSettings.toBuilder(); + listSchemasSettings = settings.listSchemasSettings.toBuilder(); + createSchemaSettings = settings.createSchemaSettings.toBuilder(); + createSchemaOperationSettings = settings.createSchemaOperationSettings.toBuilder(); + updateSchemaSettings = settings.updateSchemaSettings.toBuilder(); + updateSchemaOperationSettings = settings.updateSchemaOperationSettings.toBuilder(); + deleteSchemaSettings = settings.deleteSchemaSettings.toBuilder(); + deleteSchemaOperationSettings = settings.deleteSchemaOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getSchemaSettings, + listSchemasSettings, + createSchemaSettings, + updateSchemaSettings, + deleteSchemaSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getSchemaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .listSchemasSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .createSchemaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateSchemaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .deleteSchemaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .createSchemaOperationSettings() + .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(Schema.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(CreateSchemaMetadata.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 + .updateSchemaOperationSettings() + .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(Schema.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(UpdateSchemaMetadata.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 + .deleteSchemaOperationSettings() + .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(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(DeleteSchemaMetadata.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 getSchema. */ + public UnaryCallSettings.Builder getSchemaSettings() { + return getSchemaSettings; + } + + /** Returns the builder for the settings used for calls to listSchemas. */ + public PagedCallSettings.Builder< + ListSchemasRequest, ListSchemasResponse, ListSchemasPagedResponse> + listSchemasSettings() { + return listSchemasSettings; + } + + /** Returns the builder for the settings used for calls to createSchema. */ + public UnaryCallSettings.Builder createSchemaSettings() { + return createSchemaSettings; + } + + /** Returns the builder for the settings used for calls to createSchema. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createSchemaOperationSettings() { + return createSchemaOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateSchema. */ + public UnaryCallSettings.Builder updateSchemaSettings() { + return updateSchemaSettings; + } + + /** Returns the builder for the settings used for calls to updateSchema. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateSchemaOperationSettings() { + return updateSchemaOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteSchema. */ + public UnaryCallSettings.Builder deleteSchemaSettings() { + return deleteSchemaSettings; + } + + /** Returns the builder for the settings used for calls to deleteSchema. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteSchemaOperationSettings() { + return deleteSchemaOperationSettings; + } + + @Override + public SchemaServiceStubSettings build() throws IOException { + return new SchemaServiceStubSettings(this); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SearchServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SearchServiceStub.java new file mode 100644 index 000000000000..80ac367546ab --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SearchServiceStub.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub; + +import static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest; +import com.google.cloud.discoveryengine.v1alpha.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/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SearchServiceStubSettings.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SearchServiceStubSettings.java new file mode 100644 index 000000000000..67d10a2e3496 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SearchServiceStubSettings.java @@ -0,0 +1,391 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub; + +import static com.google.cloud.discoveryengine.v1alpha.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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.discoveryengine.v1alpha.SearchRequest; +import com.google.cloud.discoveryengine.v1alpha.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 (discoveryengine.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 and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * 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); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSearchServiceStub.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 "discoveryengine.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "discoveryengine.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SearchServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SearchServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SearchServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected 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))); + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .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/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SiteSearchEngineServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SiteSearchEngineServiceStub.java new file mode 100644 index 000000000000..ae9c6cdfc3f7 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SiteSearchEngineServiceStub.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.RecrawlUrisMetadata; +import com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest; +import com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse; +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 SiteSearchEngineService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class SiteSearchEngineServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public OperationCallable + recrawlUrisOperationCallable() { + throw new UnsupportedOperationException("Not implemented: recrawlUrisOperationCallable()"); + } + + public UnaryCallable recrawlUrisCallable() { + throw new UnsupportedOperationException("Not implemented: recrawlUrisCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SiteSearchEngineServiceStubSettings.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SiteSearchEngineServiceStubSettings.java new file mode 100644 index 000000000000..6262b86978e9 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/SiteSearchEngineServiceStubSettings.java @@ -0,0 +1,371 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata; +import com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest; +import com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse; +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 SiteSearchEngineServiceStub}. + * + *

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

    + *
  • The default service address (discoveryengine.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 recrawlUris to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SiteSearchEngineServiceStubSettings.Builder siteSearchEngineServiceSettingsBuilder =
+ *     SiteSearchEngineServiceStubSettings.newBuilder();
+ * siteSearchEngineServiceSettingsBuilder
+ *     .recrawlUrisSettings()
+ *     .setRetrySettings(
+ *         siteSearchEngineServiceSettingsBuilder
+ *             .recrawlUrisSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SiteSearchEngineServiceStubSettings siteSearchEngineServiceSettings =
+ *     siteSearchEngineServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class SiteSearchEngineServiceStubSettings + 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 recrawlUrisSettings; + private final OperationCallSettings + recrawlUrisOperationSettings; + + /** Returns the object with the settings used for calls to recrawlUris. */ + public UnaryCallSettings recrawlUrisSettings() { + return recrawlUrisSettings; + } + + /** Returns the object with the settings used for calls to recrawlUris. */ + public OperationCallSettings + recrawlUrisOperationSettings() { + return recrawlUrisOperationSettings; + } + + public SiteSearchEngineServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSiteSearchEngineServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSiteSearchEngineServiceStub.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 "discoveryengine.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "discoveryengine.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SiteSearchEngineServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SiteSearchEngineServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SiteSearchEngineServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SiteSearchEngineServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + recrawlUrisSettings = settingsBuilder.recrawlUrisSettings().build(); + recrawlUrisOperationSettings = settingsBuilder.recrawlUrisOperationSettings().build(); + } + + /** Builder for SiteSearchEngineServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder recrawlUrisSettings; + private final OperationCallSettings.Builder< + RecrawlUrisRequest, RecrawlUrisResponse, RecrawlUrisMetadata> + recrawlUrisOperationSettings; + 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); + + recrawlUrisSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + recrawlUrisOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(recrawlUrisSettings); + initDefaults(this); + } + + protected Builder(SiteSearchEngineServiceStubSettings settings) { + super(settings); + + recrawlUrisSettings = settings.recrawlUrisSettings.toBuilder(); + recrawlUrisOperationSettings = settings.recrawlUrisOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(recrawlUrisSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .recrawlUrisSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .recrawlUrisOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(RecrawlUrisResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(RecrawlUrisMetadata.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 recrawlUris. */ + public UnaryCallSettings.Builder recrawlUrisSettings() { + return recrawlUrisSettings; + } + + /** Returns the builder for the settings used for calls to recrawlUris. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + RecrawlUrisRequest, RecrawlUrisResponse, RecrawlUrisMetadata> + recrawlUrisOperationSettings() { + return recrawlUrisOperationSettings; + } + + @Override + public SiteSearchEngineServiceStubSettings build() throws IOException { + return new SiteSearchEngineServiceStubSettings(this); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/UserEventServiceStub.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/UserEventServiceStub.java new file mode 100644 index 000000000000..1a841f32c1f3 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/UserEventServiceStub.java @@ -0,0 +1,84 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.CollectUserEventRequest; +import com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata; +import com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest; +import com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse; +import com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata; +import com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest; +import com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse; +import com.google.cloud.discoveryengine.v1alpha.UserEvent; +import com.google.cloud.discoveryengine.v1alpha.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() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + 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< + ImportUserEventsRequest, ImportUserEventsResponse, ImportUserEventsMetadata> + importUserEventsOperationCallable() { + throw new UnsupportedOperationException("Not implemented: importUserEventsOperationCallable()"); + } + + public UnaryCallable importUserEventsCallable() { + throw new UnsupportedOperationException("Not implemented: importUserEventsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/UserEventServiceStubSettings.java b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/UserEventServiceStubSettings.java new file mode 100644 index 000000000000..fe006d0717bd --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/java/com/google/cloud/discoveryengine/v1alpha/stub/UserEventServiceStubSettings.java @@ -0,0 +1,525 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest; +import com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata; +import com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest; +import com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse; +import com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata; +import com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest; +import com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse; +import com.google.cloud.discoveryengine.v1alpha.UserEvent; +import com.google.cloud.discoveryengine.v1alpha.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 (discoveryengine.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 and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * 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, PurgeUserEventsMetadata> + purgeUserEventsOperationSettings; + private final UnaryCallSettings importUserEventsSettings; + private final OperationCallSettings< + ImportUserEventsRequest, ImportUserEventsResponse, ImportUserEventsMetadata> + importUserEventsOperationSettings; + + /** 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< + PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeUserEventsMetadata> + 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< + ImportUserEventsRequest, ImportUserEventsResponse, ImportUserEventsMetadata> + importUserEventsOperationSettings() { + return importUserEventsOperationSettings; + } + + public UserEventServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcUserEventServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonUserEventServiceStub.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 "discoveryengine.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "discoveryengine.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(UserEventServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(UserEventServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return UserEventServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected 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(); + } + + /** 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, PurgeUserEventsMetadata> + purgeUserEventsOperationSettings; + private final UnaryCallSettings.Builder + importUserEventsSettings; + private final OperationCallSettings.Builder< + ImportUserEventsRequest, ImportUserEventsResponse, ImportUserEventsMetadata> + importUserEventsOperationSettings; + 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))); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + 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(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .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(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(30000L)) + .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); + + writeUserEventSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + collectUserEventSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + purgeUserEventsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + purgeUserEventsOperationSettings = OperationCallSettings.newBuilder(); + importUserEventsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + importUserEventsOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + writeUserEventSettings, + collectUserEventSettings, + purgeUserEventsSettings, + importUserEventsSettings); + 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(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + writeUserEventSettings, + collectUserEventSettings, + purgeUserEventsSettings, + importUserEventsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .writeUserEventSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .collectUserEventSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_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_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_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(PurgeUserEventsMetadata.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_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(ImportUserEventsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(ImportUserEventsMetadata.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, PurgeUserEventsMetadata> + 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, ImportUserEventsMetadata> + importUserEventsOperationSettings() { + return importUserEventsOperationSettings; + } + + @Override + public UserEventServiceStubSettings build() throws IOException { + return new UserEventServiceStubSettings(this); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/main/resources/META-INF/native-image/com.google.cloud.discoveryengine.v1alpha/reflect-config.json b/java-discoveryengine/google-cloud-discoveryengine/src/main/resources/META-INF/native-image/com.google.cloud.discoveryengine.v1alpha/reflect-config.json new file mode 100644 index 000000000000..40bd3fb7ed9a --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/main/resources/META-INF/native-image/com.google.cloud.discoveryengine.v1alpha/reflect-config.json @@ -0,0 +1,3305 @@ +[ + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpBody", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpBody$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.BigQuerySource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.BigQuerySource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse$QuerySuggestion", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse$QuerySuggestion$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.CompletionInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.CompletionInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.Conversation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.Conversation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.Conversation$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ConversationContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ConversationContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ConversationMessage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ConversationMessage$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.CustomAttribute", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.CustomAttribute$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.Document", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.Document$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.Document$Content", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.Document$Content$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.DocumentInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.DocumentInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.DoubleList", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.DoubleList$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.FieldConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.FieldConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.FieldConfig$CompletableOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.FieldConfig$DynamicFacetableOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.FieldConfig$FieldType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.FieldConfig$FilterableOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.FieldConfig$IndexableOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.FieldConfig$RetrievableOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.FieldConfig$SearchableOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.GcsSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.GcsSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.GetConversationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.GetConversationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest$InlineSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest$InlineSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest$ReconciliationMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest$InlineSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest$InlineSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.Interval", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.Interval$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.MediaInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.MediaInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.PageInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.PageInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.PanelInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.PanelInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.RecommendRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.RecommendRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.RecommendResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.RecommendResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.RecommendResponse$RecommendationResult", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.RecommendResponse$RecommendationResult$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse$FailureInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse$FailureInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse$FailureInfo$FailureReason", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse$FailureInfo$FailureReason$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse$FailureInfo$FailureReason$CorpusType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.Reply", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.Reply$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.Reply$Reference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.Reply$Reference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.Schema", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.Schema$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$BoostSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$BoostSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$BoostSpec$ConditionBoostSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$BoostSpec$ConditionBoostSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$ContentSearchSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$ContentSearchSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$ContentSearchSpec$ExtractiveContentSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$ContentSearchSpec$ExtractiveContentSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$ContentSearchSpec$SnippetSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$ContentSearchSpec$SnippetSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$ContentSearchSpec$SummarySpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$ContentSearchSpec$SummarySpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$EmbeddingSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$EmbeddingSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$EmbeddingSpec$EmbeddingVector", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$EmbeddingSpec$EmbeddingVector$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$FacetSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$FacetSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$FacetSpec$FacetKey", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$FacetSpec$FacetKey$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$ImageQuery", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$ImageQuery$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$QueryExpansionSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$QueryExpansionSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$QueryExpansionSpec$Condition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$SpellCorrectionSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$SpellCorrectionSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchRequest$SpellCorrectionSpec$Mode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchResponse$Facet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchResponse$Facet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchResponse$Facet$FacetValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchResponse$Facet$FacetValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchResponse$GeoSearchDebugInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchResponse$GeoSearchDebugInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchResponse$GuidedSearchResult", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchResponse$GuidedSearchResult$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchResponse$GuidedSearchResult$RefinementAttribute", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchResponse$GuidedSearchResult$RefinementAttribute$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchResponse$QueryExpansionInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchResponse$QueryExpansionInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchResponse$SearchResult", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchResponse$SearchResult$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchResponse$Summary", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchResponse$Summary$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchResponse$Summary$SafetyAttributes", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchResponse$Summary$SafetyAttributes$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SearchResponse$Summary$SummarySkippedReason", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.SolutionType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.TextInput", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.TextInput$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.TransactionInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.TransactionInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.UserEvent", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.UserEvent$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.UserInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.UserInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.ListValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.ListValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.NullValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Struct", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Struct$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Date", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Date$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceClientHttpJsonTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..96045f6fc1c0 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceClientHttpJsonTest.java @@ -0,0 +1,139 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.discoveryengine.v1alpha.stub.HttpJsonCompletionServiceStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +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 CompletionServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static CompletionServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonCompletionServiceStub.getMethodDescriptors(), + CompletionServiceSettings.getDefaultEndpoint()); + CompletionServiceSettings settings = + CompletionServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + CompletionServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CompletionServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void completeQueryTest() throws Exception { + CompleteQueryResponse expectedResponse = + CompleteQueryResponse.newBuilder() + .addAllQuerySuggestions(new ArrayList()) + .setTailMatchTriggered(true) + .build(); + mockService.addResponse(expectedResponse); + + CompleteQueryRequest request = + CompleteQueryRequest.newBuilder() + .setDataStore( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setQuery("query107944136") + .setQueryModel("queryModel-184930495") + .setUserPseudoId("userPseudoId-1155274652") + .setIncludeTailSuggestions(true) + .build(); + + CompleteQueryResponse actualResponse = client.completeQuery(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void completeQueryExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CompleteQueryRequest request = + CompleteQueryRequest.newBuilder() + .setDataStore( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setQuery("query107944136") + .setQueryModel("queryModel-184930495") + .setUserPseudoId("userPseudoId-1155274652") + .setIncludeTailSuggestions(true) + .build(); + client.completeQuery(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceClientTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceClientTest.java new file mode 100644 index 000000000000..77009c130481 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceClientTest.java @@ -0,0 +1,145 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +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 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 CompletionServiceClientTest { + private static MockCompletionService mockCompletionService; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private CompletionServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockCompletionService = new MockCompletionService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockCompletionService, mockLocations)); + 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() + .addAllQuerySuggestions(new ArrayList()) + .setTailMatchTriggered(true) + .build(); + mockCompletionService.addResponse(expectedResponse); + + CompleteQueryRequest request = + CompleteQueryRequest.newBuilder() + .setDataStore( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setQuery("query107944136") + .setQueryModel("queryModel-184930495") + .setUserPseudoId("userPseudoId-1155274652") + .setIncludeTailSuggestions(true) + .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.getDataStore(), actualRequest.getDataStore()); + Assert.assertEquals(request.getQuery(), actualRequest.getQuery()); + Assert.assertEquals(request.getQueryModel(), actualRequest.getQueryModel()); + Assert.assertEquals(request.getUserPseudoId(), actualRequest.getUserPseudoId()); + Assert.assertEquals( + request.getIncludeTailSuggestions(), actualRequest.getIncludeTailSuggestions()); + 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() + .setDataStore( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setQuery("query107944136") + .setQueryModel("queryModel-184930495") + .setUserPseudoId("userPseudoId-1155274652") + .setIncludeTailSuggestions(true) + .build(); + client.completeQuery(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceClientHttpJsonTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..4f264c631d68 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceClientHttpJsonTest.java @@ -0,0 +1,662 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import static com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient.ListConversationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.discoveryengine.v1alpha.stub.HttpJsonConversationalSearchServiceStub; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import 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 ConversationalSearchServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static ConversationalSearchServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonConversationalSearchServiceStub.getMethodDescriptors(), + ConversationalSearchServiceSettings.getDefaultEndpoint()); + ConversationalSearchServiceSettings settings = + ConversationalSearchServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + ConversationalSearchServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ConversationalSearchServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void converseConversationTest() throws Exception { + ConverseConversationResponse expectedResponse = + ConverseConversationResponse.newBuilder() + .setReply(Reply.newBuilder().build()) + .setConversation(Conversation.newBuilder().build()) + .addAllRelatedQuestions(new ArrayList()) + .addAllSearchResults(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + TextInput query = TextInput.newBuilder().build(); + + ConverseConversationResponse actualResponse = client.converseConversation(name, query); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void converseConversationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + TextInput query = TextInput.newBuilder().build(); + client.converseConversation(name, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void converseConversationTest2() throws Exception { + ConverseConversationResponse expectedResponse = + ConverseConversationResponse.newBuilder() + .setReply(Reply.newBuilder().build()) + .setConversation(Conversation.newBuilder().build()) + .addAllRelatedQuestions(new ArrayList()) + .addAllSearchResults(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-1064/locations/location-1064/dataStores/dataStore-1064/conversations/conversation-1064"; + TextInput query = TextInput.newBuilder().build(); + + ConverseConversationResponse actualResponse = client.converseConversation(name, query); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void converseConversationExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-1064/locations/location-1064/dataStores/dataStore-1064/conversations/conversation-1064"; + TextInput query = TextInput.newBuilder().build(); + client.converseConversation(name, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createConversationTest() throws Exception { + Conversation expectedResponse = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + Conversation conversation = Conversation.newBuilder().build(); + + Conversation actualResponse = client.createConversation(parent, conversation); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createConversationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + Conversation conversation = Conversation.newBuilder().build(); + client.createConversation(parent, conversation); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createConversationTest2() throws Exception { + Conversation expectedResponse = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-3005/locations/location-3005/dataStores/dataStore-3005"; + Conversation conversation = Conversation.newBuilder().build(); + + Conversation actualResponse = client.createConversation(parent, conversation); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createConversationExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-3005/locations/location-3005/dataStores/dataStore-3005"; + Conversation conversation = Conversation.newBuilder().build(); + client.createConversation(parent, conversation); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteConversationTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + + client.deleteConversation(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteConversationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + client.deleteConversation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteConversationTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-1064/locations/location-1064/dataStores/dataStore-1064/conversations/conversation-1064"; + + client.deleteConversation(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteConversationExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-1064/locations/location-1064/dataStores/dataStore-1064/conversations/conversation-1064"; + client.deleteConversation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateConversationTest() throws Exception { + Conversation expectedResponse = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + Conversation conversation = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Conversation actualResponse = client.updateConversation(conversation, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateConversationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Conversation conversation = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateConversation(conversation, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getConversationTest() throws Exception { + Conversation expectedResponse = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + + Conversation actualResponse = client.getConversation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getConversationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + client.getConversation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getConversationTest2() throws Exception { + Conversation expectedResponse = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-1064/locations/location-1064/dataStores/dataStore-1064/conversations/conversation-1064"; + + Conversation actualResponse = client.getConversation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getConversationExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-1064/locations/location-1064/dataStores/dataStore-1064/conversations/conversation-1064"; + client.getConversation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listConversationsTest() throws Exception { + Conversation responsesElement = Conversation.newBuilder().build(); + ListConversationsResponse expectedResponse = + ListConversationsResponse.newBuilder() + .setNextPageToken("") + .addAllConversations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + + ListConversationsPagedResponse pagedListResponse = client.listConversations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getConversationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listConversationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + client.listConversations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listConversationsTest2() throws Exception { + Conversation responsesElement = Conversation.newBuilder().build(); + ListConversationsResponse expectedResponse = + ListConversationsResponse.newBuilder() + .setNextPageToken("") + .addAllConversations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-3005/locations/location-3005/dataStores/dataStore-3005"; + + ListConversationsPagedResponse pagedListResponse = client.listConversations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getConversationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listConversationsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-3005/locations/location-3005/dataStores/dataStore-3005"; + client.listConversations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceClientTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceClientTest.java new file mode 100644 index 000000000000..6a14197a9979 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceClientTest.java @@ -0,0 +1,583 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import static com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient.ListConversationsPagedResponse; + +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.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 ConversationalSearchServiceClientTest { + private static MockConversationalSearchService mockConversationalSearchService; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ConversationalSearchServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockConversationalSearchService = new MockConversationalSearchService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockConversationalSearchService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ConversationalSearchServiceSettings settings = + ConversationalSearchServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ConversationalSearchServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void converseConversationTest() throws Exception { + ConverseConversationResponse expectedResponse = + ConverseConversationResponse.newBuilder() + .setReply(Reply.newBuilder().build()) + .setConversation(Conversation.newBuilder().build()) + .addAllRelatedQuestions(new ArrayList()) + .addAllSearchResults(new ArrayList()) + .build(); + mockConversationalSearchService.addResponse(expectedResponse); + + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + TextInput query = TextInput.newBuilder().build(); + + ConverseConversationResponse actualResponse = client.converseConversation(name, query); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConversationalSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ConverseConversationRequest actualRequest = + ((ConverseConversationRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void converseConversationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversationalSearchService.addException(exception); + + try { + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + TextInput query = TextInput.newBuilder().build(); + client.converseConversation(name, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void converseConversationTest2() throws Exception { + ConverseConversationResponse expectedResponse = + ConverseConversationResponse.newBuilder() + .setReply(Reply.newBuilder().build()) + .setConversation(Conversation.newBuilder().build()) + .addAllRelatedQuestions(new ArrayList()) + .addAllSearchResults(new ArrayList()) + .build(); + mockConversationalSearchService.addResponse(expectedResponse); + + String name = "name3373707"; + TextInput query = TextInput.newBuilder().build(); + + ConverseConversationResponse actualResponse = client.converseConversation(name, query); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConversationalSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ConverseConversationRequest actualRequest = + ((ConverseConversationRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void converseConversationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversationalSearchService.addException(exception); + + try { + String name = "name3373707"; + TextInput query = TextInput.newBuilder().build(); + client.converseConversation(name, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createConversationTest() throws Exception { + Conversation expectedResponse = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + mockConversationalSearchService.addResponse(expectedResponse); + + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + Conversation conversation = Conversation.newBuilder().build(); + + Conversation actualResponse = client.createConversation(parent, conversation); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConversationalSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateConversationRequest actualRequest = ((CreateConversationRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(conversation, actualRequest.getConversation()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createConversationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversationalSearchService.addException(exception); + + try { + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + Conversation conversation = Conversation.newBuilder().build(); + client.createConversation(parent, conversation); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createConversationTest2() throws Exception { + Conversation expectedResponse = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + mockConversationalSearchService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Conversation conversation = Conversation.newBuilder().build(); + + Conversation actualResponse = client.createConversation(parent, conversation); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConversationalSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateConversationRequest actualRequest = ((CreateConversationRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(conversation, actualRequest.getConversation()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createConversationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversationalSearchService.addException(exception); + + try { + String parent = "parent-995424086"; + Conversation conversation = Conversation.newBuilder().build(); + client.createConversation(parent, conversation); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteConversationTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockConversationalSearchService.addResponse(expectedResponse); + + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + + client.deleteConversation(name); + + List actualRequests = mockConversationalSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteConversationRequest actualRequest = ((DeleteConversationRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteConversationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversationalSearchService.addException(exception); + + try { + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + client.deleteConversation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteConversationTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockConversationalSearchService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteConversation(name); + + List actualRequests = mockConversationalSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteConversationRequest actualRequest = ((DeleteConversationRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteConversationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversationalSearchService.addException(exception); + + try { + String name = "name3373707"; + client.deleteConversation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateConversationTest() throws Exception { + Conversation expectedResponse = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + mockConversationalSearchService.addResponse(expectedResponse); + + Conversation conversation = Conversation.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Conversation actualResponse = client.updateConversation(conversation, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConversationalSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateConversationRequest actualRequest = ((UpdateConversationRequest) actualRequests.get(0)); + + Assert.assertEquals(conversation, actualRequest.getConversation()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateConversationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversationalSearchService.addException(exception); + + try { + Conversation conversation = Conversation.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateConversation(conversation, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getConversationTest() throws Exception { + Conversation expectedResponse = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + mockConversationalSearchService.addResponse(expectedResponse); + + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + + Conversation actualResponse = client.getConversation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConversationalSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetConversationRequest actualRequest = ((GetConversationRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getConversationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversationalSearchService.addException(exception); + + try { + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + client.getConversation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getConversationTest2() throws Exception { + Conversation expectedResponse = + Conversation.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setUserPseudoId("userPseudoId-1155274652") + .addAllMessages(new ArrayList()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .build(); + mockConversationalSearchService.addResponse(expectedResponse); + + String name = "name3373707"; + + Conversation actualResponse = client.getConversation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConversationalSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetConversationRequest actualRequest = ((GetConversationRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getConversationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversationalSearchService.addException(exception); + + try { + String name = "name3373707"; + client.getConversation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listConversationsTest() throws Exception { + Conversation responsesElement = Conversation.newBuilder().build(); + ListConversationsResponse expectedResponse = + ListConversationsResponse.newBuilder() + .setNextPageToken("") + .addAllConversations(Arrays.asList(responsesElement)) + .build(); + mockConversationalSearchService.addResponse(expectedResponse); + + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + + ListConversationsPagedResponse pagedListResponse = client.listConversations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getConversationsList().get(0), resources.get(0)); + + List actualRequests = mockConversationalSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListConversationsRequest actualRequest = ((ListConversationsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listConversationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversationalSearchService.addException(exception); + + try { + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + client.listConversations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listConversationsTest2() throws Exception { + Conversation responsesElement = Conversation.newBuilder().build(); + ListConversationsResponse expectedResponse = + ListConversationsResponse.newBuilder() + .setNextPageToken("") + .addAllConversations(Arrays.asList(responsesElement)) + .build(); + mockConversationalSearchService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListConversationsPagedResponse pagedListResponse = client.listConversations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getConversationsList().get(0), resources.get(0)); + + List actualRequests = mockConversationalSearchService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListConversationsRequest actualRequest = ((ListConversationsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listConversationsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversationalSearchService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listConversations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceClientHttpJsonTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..094d0e58117e --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceClientHttpJsonTest.java @@ -0,0 +1,724 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import static com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient.ListDocumentsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.discoveryengine.v1alpha.stub.HttpJsonDocumentServiceStub; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.Struct; +import com.google.rpc.Status; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class DocumentServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static DocumentServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonDocumentServiceStub.getMethodDescriptors(), + DocumentServiceSettings.getDefaultEndpoint()); + DocumentServiceSettings settings = + DocumentServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + DocumentServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = DocumentServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void getDocumentTest() throws Exception { + Document expectedResponse = + Document.newBuilder() + .setName( + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]") + .toString()) + .setId("id3355") + .setSchemaId("schemaId-697673060") + .setContent(Document.Content.newBuilder().build()) + .setParentDocumentId("parentDocumentId1990105056") + .setDerivedStructData(Struct.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + DocumentName name = + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]"); + + Document actualResponse = client.getDocument(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getDocumentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DocumentName name = + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]"); + client.getDocument(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDocumentTest2() throws Exception { + Document expectedResponse = + Document.newBuilder() + .setName( + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]") + .toString()) + .setId("id3355") + .setSchemaId("schemaId-697673060") + .setContent(Document.Content.newBuilder().build()) + .setParentDocumentId("parentDocumentId1990105056") + .setDerivedStructData(Struct.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-2446/locations/location-2446/dataStores/dataStore-2446/branches/branche-2446/documents/document-2446"; + + Document actualResponse = client.getDocument(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getDocumentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-2446/locations/location-2446/dataStores/dataStore-2446/branches/branche-2446/documents/document-2446"; + client.getDocument(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDocumentsTest() throws Exception { + Document responsesElement = Document.newBuilder().build(); + ListDocumentsResponse expectedResponse = + ListDocumentsResponse.newBuilder() + .setNextPageToken("") + .addAllDocuments(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + BranchName parent = + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]"); + + ListDocumentsPagedResponse pagedListResponse = client.listDocuments(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDocumentsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listDocumentsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BranchName parent = + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]"); + client.listDocuments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDocumentsTest2() throws Exception { + Document responsesElement = Document.newBuilder().build(); + ListDocumentsResponse expectedResponse = + ListDocumentsResponse.newBuilder() + .setNextPageToken("") + .addAllDocuments(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "projects/project-3187/locations/location-3187/dataStores/dataStore-3187/branches/branche-3187"; + + ListDocumentsPagedResponse pagedListResponse = client.listDocuments(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDocumentsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listDocumentsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-3187/locations/location-3187/dataStores/dataStore-3187/branches/branche-3187"; + client.listDocuments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDocumentTest() throws Exception { + Document expectedResponse = + Document.newBuilder() + .setName( + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]") + .toString()) + .setId("id3355") + .setSchemaId("schemaId-697673060") + .setContent(Document.Content.newBuilder().build()) + .setParentDocumentId("parentDocumentId1990105056") + .setDerivedStructData(Struct.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + BranchName parent = + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]"); + Document document = Document.newBuilder().build(); + String documentId = "documentId-814940266"; + + Document actualResponse = client.createDocument(parent, document, documentId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createDocumentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BranchName parent = + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]"); + Document document = Document.newBuilder().build(); + String documentId = "documentId-814940266"; + client.createDocument(parent, document, documentId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDocumentTest2() throws Exception { + Document expectedResponse = + Document.newBuilder() + .setName( + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]") + .toString()) + .setId("id3355") + .setSchemaId("schemaId-697673060") + .setContent(Document.Content.newBuilder().build()) + .setParentDocumentId("parentDocumentId1990105056") + .setDerivedStructData(Struct.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "projects/project-3187/locations/location-3187/dataStores/dataStore-3187/branches/branche-3187"; + Document document = Document.newBuilder().build(); + String documentId = "documentId-814940266"; + + Document actualResponse = client.createDocument(parent, document, documentId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createDocumentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-3187/locations/location-3187/dataStores/dataStore-3187/branches/branche-3187"; + Document document = Document.newBuilder().build(); + String documentId = "documentId-814940266"; + client.createDocument(parent, document, documentId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateDocumentTest() throws Exception { + Document expectedResponse = + Document.newBuilder() + .setName( + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]") + .toString()) + .setId("id3355") + .setSchemaId("schemaId-697673060") + .setContent(Document.Content.newBuilder().build()) + .setParentDocumentId("parentDocumentId1990105056") + .setDerivedStructData(Struct.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + UpdateDocumentRequest request = + UpdateDocumentRequest.newBuilder() + .setDocument( + Document.newBuilder() + .setName( + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]") + .toString()) + .setId("id3355") + .setSchemaId("schemaId-697673060") + .setContent(Document.Content.newBuilder().build()) + .setParentDocumentId("parentDocumentId1990105056") + .setDerivedStructData(Struct.newBuilder().build()) + .build()) + .setAllowMissing(true) + .build(); + + Document actualResponse = client.updateDocument(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateDocumentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UpdateDocumentRequest request = + UpdateDocumentRequest.newBuilder() + .setDocument( + Document.newBuilder() + .setName( + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", + "[LOCATION]", + "[DATA_STORE]", + "[BRANCH]", + "[DOCUMENT]") + .toString()) + .setId("id3355") + .setSchemaId("schemaId-697673060") + .setContent(Document.Content.newBuilder().build()) + .setParentDocumentId("parentDocumentId1990105056") + .setDerivedStructData(Struct.newBuilder().build()) + .build()) + .setAllowMissing(true) + .build(); + client.updateDocument(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDocumentTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + DocumentName name = + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]"); + + client.deleteDocument(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteDocumentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DocumentName name = + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]"); + client.deleteDocument(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDocumentTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-2446/locations/location-2446/dataStores/dataStore-2446/branches/branche-2446/documents/document-2446"; + + client.deleteDocument(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteDocumentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-2446/locations/location-2446/dataStores/dataStore-2446/branches/branche-2446/documents/document-2446"; + client.deleteDocument(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void importDocumentsTest() throws Exception { + ImportDocumentsResponse expectedResponse = + ImportDocumentsResponse.newBuilder() + .addAllErrorSamples(new ArrayList()) + .setErrorConfig(ImportErrorConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("importDocumentsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ImportDocumentsRequest request = + ImportDocumentsRequest.newBuilder() + .setParent( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setErrorConfig(ImportErrorConfig.newBuilder().build()) + .setAutoGenerateIds(true) + .setIdField("idField1629396127") + .build(); + + ImportDocumentsResponse actualResponse = client.importDocumentsAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void importDocumentsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ImportDocumentsRequest request = + ImportDocumentsRequest.newBuilder() + .setParent( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setErrorConfig(ImportErrorConfig.newBuilder().build()) + .setAutoGenerateIds(true) + .setIdField("idField1629396127") + .build(); + client.importDocumentsAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void purgeDocumentsTest() throws Exception { + PurgeDocumentsResponse expectedResponse = + PurgeDocumentsResponse.newBuilder() + .setPurgeCount(575305851) + .addAllPurgeSample(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("purgeDocumentsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + PurgeDocumentsRequest request = + PurgeDocumentsRequest.newBuilder() + .setParent( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setFilter("filter-1274492040") + .setForce(true) + .build(); + + PurgeDocumentsResponse actualResponse = client.purgeDocumentsAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void purgeDocumentsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PurgeDocumentsRequest request = + PurgeDocumentsRequest.newBuilder() + .setParent( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setFilter("filter-1274492040") + .setForce(true) + .build(); + client.purgeDocumentsAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceClientTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceClientTest.java new file mode 100644 index 000000000000..8be0bbcc9d84 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceClientTest.java @@ -0,0 +1,651 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import static com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient.ListDocumentsPagedResponse; + +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.Struct; +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 DocumentServiceClientTest { + private static MockDocumentService mockDocumentService; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private DocumentServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockDocumentService = new MockDocumentService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockDocumentService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + DocumentServiceSettings settings = + DocumentServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = DocumentServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getDocumentTest() throws Exception { + Document expectedResponse = + Document.newBuilder() + .setName( + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]") + .toString()) + .setId("id3355") + .setSchemaId("schemaId-697673060") + .setContent(Document.Content.newBuilder().build()) + .setParentDocumentId("parentDocumentId1990105056") + .setDerivedStructData(Struct.newBuilder().build()) + .build(); + mockDocumentService.addResponse(expectedResponse); + + DocumentName name = + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]"); + + Document actualResponse = client.getDocument(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDocumentRequest actualRequest = ((GetDocumentRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDocumentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + DocumentName name = + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]"); + client.getDocument(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDocumentTest2() throws Exception { + Document expectedResponse = + Document.newBuilder() + .setName( + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]") + .toString()) + .setId("id3355") + .setSchemaId("schemaId-697673060") + .setContent(Document.Content.newBuilder().build()) + .setParentDocumentId("parentDocumentId1990105056") + .setDerivedStructData(Struct.newBuilder().build()) + .build(); + mockDocumentService.addResponse(expectedResponse); + + String name = "name3373707"; + + Document actualResponse = client.getDocument(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDocumentRequest actualRequest = ((GetDocumentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDocumentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + String name = "name3373707"; + client.getDocument(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDocumentsTest() throws Exception { + Document responsesElement = Document.newBuilder().build(); + ListDocumentsResponse expectedResponse = + ListDocumentsResponse.newBuilder() + .setNextPageToken("") + .addAllDocuments(Arrays.asList(responsesElement)) + .build(); + mockDocumentService.addResponse(expectedResponse); + + BranchName parent = + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]"); + + ListDocumentsPagedResponse pagedListResponse = client.listDocuments(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDocumentsList().get(0), resources.get(0)); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListDocumentsRequest actualRequest = ((ListDocumentsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listDocumentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + BranchName parent = + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]"); + client.listDocuments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDocumentsTest2() throws Exception { + Document responsesElement = Document.newBuilder().build(); + ListDocumentsResponse expectedResponse = + ListDocumentsResponse.newBuilder() + .setNextPageToken("") + .addAllDocuments(Arrays.asList(responsesElement)) + .build(); + mockDocumentService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListDocumentsPagedResponse pagedListResponse = client.listDocuments(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDocumentsList().get(0), resources.get(0)); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListDocumentsRequest actualRequest = ((ListDocumentsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listDocumentsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listDocuments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDocumentTest() throws Exception { + Document expectedResponse = + Document.newBuilder() + .setName( + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]") + .toString()) + .setId("id3355") + .setSchemaId("schemaId-697673060") + .setContent(Document.Content.newBuilder().build()) + .setParentDocumentId("parentDocumentId1990105056") + .setDerivedStructData(Struct.newBuilder().build()) + .build(); + mockDocumentService.addResponse(expectedResponse); + + BranchName parent = + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]"); + Document document = Document.newBuilder().build(); + String documentId = "documentId-814940266"; + + Document actualResponse = client.createDocument(parent, document, documentId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateDocumentRequest actualRequest = ((CreateDocumentRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(document, actualRequest.getDocument()); + Assert.assertEquals(documentId, actualRequest.getDocumentId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createDocumentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + BranchName parent = + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]"); + Document document = Document.newBuilder().build(); + String documentId = "documentId-814940266"; + client.createDocument(parent, document, documentId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDocumentTest2() throws Exception { + Document expectedResponse = + Document.newBuilder() + .setName( + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]") + .toString()) + .setId("id3355") + .setSchemaId("schemaId-697673060") + .setContent(Document.Content.newBuilder().build()) + .setParentDocumentId("parentDocumentId1990105056") + .setDerivedStructData(Struct.newBuilder().build()) + .build(); + mockDocumentService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Document document = Document.newBuilder().build(); + String documentId = "documentId-814940266"; + + Document actualResponse = client.createDocument(parent, document, documentId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateDocumentRequest actualRequest = ((CreateDocumentRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(document, actualRequest.getDocument()); + Assert.assertEquals(documentId, actualRequest.getDocumentId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createDocumentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + String parent = "parent-995424086"; + Document document = Document.newBuilder().build(); + String documentId = "documentId-814940266"; + client.createDocument(parent, document, documentId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateDocumentTest() throws Exception { + Document expectedResponse = + Document.newBuilder() + .setName( + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]") + .toString()) + .setId("id3355") + .setSchemaId("schemaId-697673060") + .setContent(Document.Content.newBuilder().build()) + .setParentDocumentId("parentDocumentId1990105056") + .setDerivedStructData(Struct.newBuilder().build()) + .build(); + mockDocumentService.addResponse(expectedResponse); + + UpdateDocumentRequest request = + UpdateDocumentRequest.newBuilder() + .setDocument(Document.newBuilder().build()) + .setAllowMissing(true) + .build(); + + Document actualResponse = client.updateDocument(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateDocumentRequest actualRequest = ((UpdateDocumentRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getDocument(), actualRequest.getDocument()); + Assert.assertEquals(request.getAllowMissing(), actualRequest.getAllowMissing()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateDocumentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + UpdateDocumentRequest request = + UpdateDocumentRequest.newBuilder() + .setDocument(Document.newBuilder().build()) + .setAllowMissing(true) + .build(); + client.updateDocument(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDocumentTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockDocumentService.addResponse(expectedResponse); + + DocumentName name = + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]"); + + client.deleteDocument(name); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDocumentRequest actualRequest = ((DeleteDocumentRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteDocumentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + DocumentName name = + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]"); + client.deleteDocument(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDocumentTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockDocumentService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteDocument(name); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDocumentRequest actualRequest = ((DeleteDocumentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteDocumentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + String name = "name3373707"; + client.deleteDocument(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void importDocumentsTest() throws Exception { + ImportDocumentsResponse expectedResponse = + ImportDocumentsResponse.newBuilder() + .addAllErrorSamples(new ArrayList()) + .setErrorConfig(ImportErrorConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("importDocumentsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentService.addResponse(resultOperation); + + ImportDocumentsRequest request = + ImportDocumentsRequest.newBuilder() + .setParent( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setErrorConfig(ImportErrorConfig.newBuilder().build()) + .setAutoGenerateIds(true) + .setIdField("idField1629396127") + .build(); + + ImportDocumentsResponse actualResponse = client.importDocumentsAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ImportDocumentsRequest actualRequest = ((ImportDocumentsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getInlineSource(), actualRequest.getInlineSource()); + Assert.assertEquals(request.getGcsSource(), actualRequest.getGcsSource()); + Assert.assertEquals(request.getBigquerySource(), actualRequest.getBigquerySource()); + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getErrorConfig(), actualRequest.getErrorConfig()); + Assert.assertEquals(request.getReconciliationMode(), actualRequest.getReconciliationMode()); + Assert.assertEquals(request.getAutoGenerateIds(), actualRequest.getAutoGenerateIds()); + Assert.assertEquals(request.getIdField(), actualRequest.getIdField()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void importDocumentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + ImportDocumentsRequest request = + ImportDocumentsRequest.newBuilder() + .setParent( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setErrorConfig(ImportErrorConfig.newBuilder().build()) + .setAutoGenerateIds(true) + .setIdField("idField1629396127") + .build(); + client.importDocumentsAsync(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 purgeDocumentsTest() throws Exception { + PurgeDocumentsResponse expectedResponse = + PurgeDocumentsResponse.newBuilder() + .setPurgeCount(575305851) + .addAllPurgeSample(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("purgeDocumentsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDocumentService.addResponse(resultOperation); + + PurgeDocumentsRequest request = + PurgeDocumentsRequest.newBuilder() + .setParent( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setFilter("filter-1274492040") + .setForce(true) + .build(); + + PurgeDocumentsResponse actualResponse = client.purgeDocumentsAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDocumentService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PurgeDocumentsRequest actualRequest = ((PurgeDocumentsRequest) 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 purgeDocumentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDocumentService.addException(exception); + + try { + PurgeDocumentsRequest request = + PurgeDocumentsRequest.newBuilder() + .setParent( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setFilter("filter-1274492040") + .setForce(true) + .build(); + client.purgeDocumentsAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockCompletionService.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockCompletionService.java new file mode 100644 index 000000000000..837400c14512 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockCompletionService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +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/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockCompletionServiceImpl.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockCompletionServiceImpl.java new file mode 100644 index 000000000000..8dffd0153aed --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockCompletionServiceImpl.java @@ -0,0 +1,81 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.discoveryengine.v1alpha.CompletionServiceGrpc.CompletionServiceImplBase; +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()))); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockConversationalSearchService.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockConversationalSearchService.java new file mode 100644 index 000000000000..8133e46f908e --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockConversationalSearchService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +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 MockConversationalSearchService implements MockGrpcService { + private final MockConversationalSearchServiceImpl serviceImpl; + + public MockConversationalSearchService() { + serviceImpl = new MockConversationalSearchServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockConversationalSearchServiceImpl.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockConversationalSearchServiceImpl.java new file mode 100644 index 000000000000..e9ae1cd46475 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockConversationalSearchServiceImpl.java @@ -0,0 +1,189 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceGrpc.ConversationalSearchServiceImplBase; +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 MockConversationalSearchServiceImpl extends ConversationalSearchServiceImplBase { + private List requests; + private Queue responses; + + public MockConversationalSearchServiceImpl() { + 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 converseConversation( + ConverseConversationRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ConverseConversationResponse) { + requests.add(request); + responseObserver.onNext(((ConverseConversationResponse) 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 ConverseConversation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ConverseConversationResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createConversation( + CreateConversationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Conversation) { + requests.add(request); + responseObserver.onNext(((Conversation) 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 CreateConversation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Conversation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteConversation( + DeleteConversationRequest 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 DeleteConversation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateConversation( + UpdateConversationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Conversation) { + requests.add(request); + responseObserver.onNext(((Conversation) 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 UpdateConversation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Conversation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getConversation( + GetConversationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Conversation) { + requests.add(request); + responseObserver.onNext(((Conversation) 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 GetConversation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Conversation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listConversations( + ListConversationsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListConversationsResponse) { + requests.add(request); + responseObserver.onNext(((ListConversationsResponse) 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 ListConversations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListConversationsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockDocumentService.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockDocumentService.java new file mode 100644 index 000000000000..7d88a818dfa5 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockDocumentService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +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 MockDocumentService implements MockGrpcService { + private final MockDocumentServiceImpl serviceImpl; + + public MockDocumentService() { + serviceImpl = new MockDocumentServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockDocumentServiceImpl.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockDocumentServiceImpl.java new file mode 100644 index 000000000000..3b689fbeef9f --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockDocumentServiceImpl.java @@ -0,0 +1,208 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceGrpc.DocumentServiceImplBase; +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 MockDocumentServiceImpl extends DocumentServiceImplBase { + private List requests; + private Queue responses; + + public MockDocumentServiceImpl() { + 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 getDocument(GetDocumentRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Document) { + requests.add(request); + responseObserver.onNext(((Document) 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 GetDocument, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Document.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listDocuments( + ListDocumentsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListDocumentsResponse) { + requests.add(request); + responseObserver.onNext(((ListDocumentsResponse) 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 ListDocuments, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListDocumentsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createDocument( + CreateDocumentRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Document) { + requests.add(request); + responseObserver.onNext(((Document) 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 CreateDocument, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Document.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateDocument( + UpdateDocumentRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Document) { + requests.add(request); + responseObserver.onNext(((Document) 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 UpdateDocument, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Document.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteDocument( + DeleteDocumentRequest 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 DeleteDocument, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void importDocuments( + ImportDocumentsRequest 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 ImportDocuments, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void purgeDocuments( + PurgeDocumentsRequest 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 PurgeDocuments, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockLocations.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockLocations.java new file mode 100644 index 000000000000..ac060053b6ff --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +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 MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockLocationsImpl.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockLocationsImpl.java new file mode 100644 index 000000000000..04e096fe94a2 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockLocationsImpl.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +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 MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + 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<>(); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockRecommendationService.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockRecommendationService.java new file mode 100644 index 000000000000..885d36476ddc --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockRecommendationService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +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 MockRecommendationService implements MockGrpcService { + private final MockRecommendationServiceImpl serviceImpl; + + public MockRecommendationService() { + serviceImpl = new MockRecommendationServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockRecommendationServiceImpl.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockRecommendationServiceImpl.java new file mode 100644 index 000000000000..226f83e03fa5 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockRecommendationServiceImpl.java @@ -0,0 +1,81 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.discoveryengine.v1alpha.RecommendationServiceGrpc.RecommendationServiceImplBase; +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 MockRecommendationServiceImpl extends RecommendationServiceImplBase { + private List requests; + private Queue responses; + + public MockRecommendationServiceImpl() { + 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 recommend( + RecommendRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RecommendResponse) { + requests.add(request); + responseObserver.onNext(((RecommendResponse) 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 Recommend, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RecommendResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSchemaService.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSchemaService.java new file mode 100644 index 000000000000..5f300d509dd3 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSchemaService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +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 MockSchemaService implements MockGrpcService { + private final MockSchemaServiceImpl serviceImpl; + + public MockSchemaService() { + serviceImpl = new MockSchemaServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSchemaServiceImpl.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSchemaServiceImpl.java new file mode 100644 index 000000000000..c8d2aa59e1a6 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSchemaServiceImpl.java @@ -0,0 +1,165 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceGrpc.SchemaServiceImplBase; +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 MockSchemaServiceImpl extends SchemaServiceImplBase { + private List requests; + private Queue responses; + + public MockSchemaServiceImpl() { + 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 getSchema(GetSchemaRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Schema) { + requests.add(request); + responseObserver.onNext(((Schema) 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 GetSchema, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Schema.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listSchemas( + ListSchemasRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListSchemasResponse) { + requests.add(request); + responseObserver.onNext(((ListSchemasResponse) 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 ListSchemas, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListSchemasResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createSchema( + CreateSchemaRequest 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 CreateSchema, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateSchema( + UpdateSchemaRequest 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 UpdateSchema, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteSchema( + DeleteSchemaRequest 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 DeleteSchema, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSearchService.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSearchService.java new file mode 100644 index 000000000000..1d1e77fabf4b --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSearchService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +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/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSearchServiceImpl.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSearchServiceImpl.java new file mode 100644 index 000000000000..0536c804b6d5 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSearchServiceImpl.java @@ -0,0 +1,80 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.discoveryengine.v1alpha.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/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSiteSearchEngineService.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSiteSearchEngineService.java new file mode 100644 index 000000000000..409f3128f5f2 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSiteSearchEngineService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +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 MockSiteSearchEngineService implements MockGrpcService { + private final MockSiteSearchEngineServiceImpl serviceImpl; + + public MockSiteSearchEngineService() { + serviceImpl = new MockSiteSearchEngineServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSiteSearchEngineServiceImpl.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSiteSearchEngineServiceImpl.java new file mode 100644 index 000000000000..f2c17b7947d3 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockSiteSearchEngineServiceImpl.java @@ -0,0 +1,81 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceGrpc.SiteSearchEngineServiceImplBase; +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 MockSiteSearchEngineServiceImpl extends SiteSearchEngineServiceImplBase { + private List requests; + private Queue responses; + + public MockSiteSearchEngineServiceImpl() { + 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 recrawlUris(RecrawlUrisRequest 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 RecrawlUris, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockUserEventService.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockUserEventService.java new file mode 100644 index 000000000000..f628243f043d --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockUserEventService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +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/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockUserEventServiceImpl.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockUserEventServiceImpl.java new file mode 100644 index 000000000000..05454bf4bcd8 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/MockUserEventServiceImpl.java @@ -0,0 +1,146 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.HttpBody; +import com.google.api.core.BetaApi; +import com.google.cloud.discoveryengine.v1alpha.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()))); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceClientHttpJsonTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..f93784ae3858 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceClientHttpJsonTest.java @@ -0,0 +1,147 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.discoveryengine.v1alpha.stub.HttpJsonRecommendationServiceStub; +import com.google.protobuf.Value; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +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 RecommendationServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static RecommendationServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonRecommendationServiceStub.getMethodDescriptors(), + RecommendationServiceSettings.getDefaultEndpoint()); + RecommendationServiceSettings settings = + RecommendationServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + RecommendationServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RecommendationServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void recommendTest() throws Exception { + RecommendResponse expectedResponse = + RecommendResponse.newBuilder() + .addAllResults(new ArrayList()) + .setAttributionToken("attributionToken104706234") + .addAllMissingIds(new ArrayList()) + .setValidateOnly(true) + .build(); + mockService.addResponse(expectedResponse); + + RecommendRequest request = + RecommendRequest.newBuilder() + .setServingConfig( + ServingConfigName.ofProjectLocationDataStoreServingConfigName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]") + .toString()) + .setUserEvent(UserEvent.newBuilder().build()) + .setPageSize(883849137) + .setFilter("filter-1274492040") + .setValidateOnly(true) + .putAllParams(new HashMap()) + .putAllUserLabels(new HashMap()) + .build(); + + RecommendResponse actualResponse = client.recommend(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void recommendExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RecommendRequest request = + RecommendRequest.newBuilder() + .setServingConfig( + ServingConfigName.ofProjectLocationDataStoreServingConfigName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]") + .toString()) + .setUserEvent(UserEvent.newBuilder().build()) + .setPageSize(883849137) + .setFilter("filter-1274492040") + .setValidateOnly(true) + .putAllParams(new HashMap()) + .putAllUserLabels(new HashMap()) + .build(); + client.recommend(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceClientTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceClientTest.java new file mode 100644 index 000000000000..702f4fb87584 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceClientTest.java @@ -0,0 +1,154 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +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 RecommendationServiceClientTest { + private static MockLocations mockLocations; + private static MockRecommendationService mockRecommendationService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private RecommendationServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockRecommendationService = new MockRecommendationService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockRecommendationService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + RecommendationServiceSettings settings = + RecommendationServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RecommendationServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void recommendTest() throws Exception { + RecommendResponse expectedResponse = + RecommendResponse.newBuilder() + .addAllResults(new ArrayList()) + .setAttributionToken("attributionToken104706234") + .addAllMissingIds(new ArrayList()) + .setValidateOnly(true) + .build(); + mockRecommendationService.addResponse(expectedResponse); + + RecommendRequest request = + RecommendRequest.newBuilder() + .setServingConfig( + ServingConfigName.ofProjectLocationDataStoreServingConfigName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]") + .toString()) + .setUserEvent(UserEvent.newBuilder().build()) + .setPageSize(883849137) + .setFilter("filter-1274492040") + .setValidateOnly(true) + .putAllParams(new HashMap()) + .putAllUserLabels(new HashMap()) + .build(); + + RecommendResponse actualResponse = client.recommend(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRecommendationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RecommendRequest actualRequest = ((RecommendRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getServingConfig(), actualRequest.getServingConfig()); + Assert.assertEquals(request.getUserEvent(), actualRequest.getUserEvent()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getValidateOnly(), actualRequest.getValidateOnly()); + Assert.assertEquals(request.getParamsMap(), actualRequest.getParamsMap()); + Assert.assertEquals(request.getUserLabelsMap(), actualRequest.getUserLabelsMap()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void recommendExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRecommendationService.addException(exception); + + try { + RecommendRequest request = + RecommendRequest.newBuilder() + .setServingConfig( + ServingConfigName.ofProjectLocationDataStoreServingConfigName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]") + .toString()) + .setUserEvent(UserEvent.newBuilder().build()) + .setPageSize(883849137) + .setFilter("filter-1274492040") + .setValidateOnly(true) + .putAllParams(new HashMap()) + .putAllUserLabels(new HashMap()) + .build(); + client.recommend(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceClientHttpJsonTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..4db472bf664d --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceClientHttpJsonTest.java @@ -0,0 +1,573 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import static com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient.ListSchemasPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.discoveryengine.v1alpha.stub.HttpJsonSchemaServiceStub; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SchemaServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SchemaServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSchemaServiceStub.getMethodDescriptors(), + SchemaServiceSettings.getDefaultEndpoint()); + SchemaServiceSettings settings = + SchemaServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SchemaServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SchemaServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void getSchemaTest() throws Exception { + Schema expectedResponse = + Schema.newBuilder() + .setName( + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") + .toString()) + .addAllFieldConfigs(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + SchemaName name = + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]"); + + Schema actualResponse = client.getSchema(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSchemaExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SchemaName name = + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]"); + client.getSchema(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSchemaTest2() throws Exception { + Schema expectedResponse = + Schema.newBuilder() + .setName( + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") + .toString()) + .addAllFieldConfigs(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-3094/locations/location-3094/dataStores/dataStore-3094/schemas/schema-3094"; + + Schema actualResponse = client.getSchema(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSchemaExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-3094/locations/location-3094/dataStores/dataStore-3094/schemas/schema-3094"; + client.getSchema(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSchemasTest() throws Exception { + Schema responsesElement = Schema.newBuilder().build(); + ListSchemasResponse expectedResponse = + ListSchemasResponse.newBuilder() + .setNextPageToken("") + .addAllSchemas(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + + ListSchemasPagedResponse pagedListResponse = client.listSchemas(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSchemasList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listSchemasExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + client.listSchemas(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSchemasTest2() throws Exception { + Schema responsesElement = Schema.newBuilder().build(); + ListSchemasResponse expectedResponse = + ListSchemasResponse.newBuilder() + .setNextPageToken("") + .addAllSchemas(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-3005/locations/location-3005/dataStores/dataStore-3005"; + + ListSchemasPagedResponse pagedListResponse = client.listSchemas(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSchemasList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listSchemasExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-3005/locations/location-3005/dataStores/dataStore-3005"; + client.listSchemas(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSchemaTest() throws Exception { + Schema expectedResponse = + Schema.newBuilder() + .setName( + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") + .toString()) + .addAllFieldConfigs(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSchemaTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + Schema schema = Schema.newBuilder().build(); + String schemaId = "schemaId-697673060"; + + Schema actualResponse = client.createSchemaAsync(parent, schema, schemaId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSchemaExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + Schema schema = Schema.newBuilder().build(); + String schemaId = "schemaId-697673060"; + client.createSchemaAsync(parent, schema, schemaId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createSchemaTest2() throws Exception { + Schema expectedResponse = + Schema.newBuilder() + .setName( + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") + .toString()) + .addAllFieldConfigs(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSchemaTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-3005/locations/location-3005/dataStores/dataStore-3005"; + Schema schema = Schema.newBuilder().build(); + String schemaId = "schemaId-697673060"; + + Schema actualResponse = client.createSchemaAsync(parent, schema, schemaId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSchemaExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-3005/locations/location-3005/dataStores/dataStore-3005"; + Schema schema = Schema.newBuilder().build(); + String schemaId = "schemaId-697673060"; + client.createSchemaAsync(parent, schema, schemaId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateSchemaTest() throws Exception { + Schema expectedResponse = + Schema.newBuilder() + .setName( + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") + .toString()) + .addAllFieldConfigs(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateSchemaTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + UpdateSchemaRequest request = + UpdateSchemaRequest.newBuilder() + .setSchema( + Schema.newBuilder() + .setName( + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") + .toString()) + .addAllFieldConfigs(new ArrayList()) + .build()) + .setAllowMissing(true) + .build(); + + Schema actualResponse = client.updateSchemaAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateSchemaExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UpdateSchemaRequest request = + UpdateSchemaRequest.newBuilder() + .setSchema( + Schema.newBuilder() + .setName( + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") + .toString()) + .addAllFieldConfigs(new ArrayList()) + .build()) + .setAllowMissing(true) + .build(); + client.updateSchemaAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteSchemaTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteSchemaTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + SchemaName name = + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]"); + + client.deleteSchemaAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteSchemaExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SchemaName name = + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]"); + client.deleteSchemaAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteSchemaTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteSchemaTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-3094/locations/location-3094/dataStores/dataStore-3094/schemas/schema-3094"; + + client.deleteSchemaAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteSchemaExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-3094/locations/location-3094/dataStores/dataStore-3094/schemas/schema-3094"; + client.deleteSchemaAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceClientTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceClientTest.java new file mode 100644 index 000000000000..b20c3f594d38 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceClientTest.java @@ -0,0 +1,528 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import static com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient.ListSchemasPagedResponse; + +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 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 SchemaServiceClientTest { + private static MockLocations mockLocations; + private static MockSchemaService mockSchemaService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private SchemaServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSchemaService = new MockSchemaService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSchemaService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SchemaServiceSettings settings = + SchemaServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SchemaServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getSchemaTest() throws Exception { + Schema expectedResponse = + Schema.newBuilder() + .setName( + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") + .toString()) + .addAllFieldConfigs(new ArrayList()) + .build(); + mockSchemaService.addResponse(expectedResponse); + + SchemaName name = + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]"); + + Schema actualResponse = client.getSchema(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSchemaRequest actualRequest = ((GetSchemaRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSchemaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + SchemaName name = + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]"); + client.getSchema(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSchemaTest2() throws Exception { + Schema expectedResponse = + Schema.newBuilder() + .setName( + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") + .toString()) + .addAllFieldConfigs(new ArrayList()) + .build(); + mockSchemaService.addResponse(expectedResponse); + + String name = "name3373707"; + + Schema actualResponse = client.getSchema(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSchemaRequest actualRequest = ((GetSchemaRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSchemaExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + String name = "name3373707"; + client.getSchema(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSchemasTest() throws Exception { + Schema responsesElement = Schema.newBuilder().build(); + ListSchemasResponse expectedResponse = + ListSchemasResponse.newBuilder() + .setNextPageToken("") + .addAllSchemas(Arrays.asList(responsesElement)) + .build(); + mockSchemaService.addResponse(expectedResponse); + + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + + ListSchemasPagedResponse pagedListResponse = client.listSchemas(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSchemasList().get(0), resources.get(0)); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSchemasRequest actualRequest = ((ListSchemasRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSchemasExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + client.listSchemas(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSchemasTest2() throws Exception { + Schema responsesElement = Schema.newBuilder().build(); + ListSchemasResponse expectedResponse = + ListSchemasResponse.newBuilder() + .setNextPageToken("") + .addAllSchemas(Arrays.asList(responsesElement)) + .build(); + mockSchemaService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListSchemasPagedResponse pagedListResponse = client.listSchemas(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSchemasList().get(0), resources.get(0)); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSchemasRequest actualRequest = ((ListSchemasRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSchemasExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listSchemas(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSchemaTest() throws Exception { + Schema expectedResponse = + Schema.newBuilder() + .setName( + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") + .toString()) + .addAllFieldConfigs(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSchemaTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSchemaService.addResponse(resultOperation); + + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + Schema schema = Schema.newBuilder().build(); + String schemaId = "schemaId-697673060"; + + Schema actualResponse = client.createSchemaAsync(parent, schema, schemaId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSchemaRequest actualRequest = ((CreateSchemaRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(schema, actualRequest.getSchema()); + Assert.assertEquals(schemaId, actualRequest.getSchemaId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSchemaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + Schema schema = Schema.newBuilder().build(); + String schemaId = "schemaId-697673060"; + client.createSchemaAsync(parent, schema, schemaId).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 createSchemaTest2() throws Exception { + Schema expectedResponse = + Schema.newBuilder() + .setName( + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") + .toString()) + .addAllFieldConfigs(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSchemaTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSchemaService.addResponse(resultOperation); + + String parent = "parent-995424086"; + Schema schema = Schema.newBuilder().build(); + String schemaId = "schemaId-697673060"; + + Schema actualResponse = client.createSchemaAsync(parent, schema, schemaId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSchemaRequest actualRequest = ((CreateSchemaRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(schema, actualRequest.getSchema()); + Assert.assertEquals(schemaId, actualRequest.getSchemaId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSchemaExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + String parent = "parent-995424086"; + Schema schema = Schema.newBuilder().build(); + String schemaId = "schemaId-697673060"; + client.createSchemaAsync(parent, schema, schemaId).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 updateSchemaTest() throws Exception { + Schema expectedResponse = + Schema.newBuilder() + .setName( + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") + .toString()) + .addAllFieldConfigs(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateSchemaTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSchemaService.addResponse(resultOperation); + + UpdateSchemaRequest request = + UpdateSchemaRequest.newBuilder() + .setSchema(Schema.newBuilder().build()) + .setAllowMissing(true) + .build(); + + Schema actualResponse = client.updateSchemaAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSchemaRequest actualRequest = ((UpdateSchemaRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getSchema(), actualRequest.getSchema()); + Assert.assertEquals(request.getAllowMissing(), actualRequest.getAllowMissing()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateSchemaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + UpdateSchemaRequest request = + UpdateSchemaRequest.newBuilder() + .setSchema(Schema.newBuilder().build()) + .setAllowMissing(true) + .build(); + client.updateSchemaAsync(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 deleteSchemaTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteSchemaTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSchemaService.addResponse(resultOperation); + + SchemaName name = + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]"); + + client.deleteSchemaAsync(name).get(); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSchemaRequest actualRequest = ((DeleteSchemaRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSchemaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + SchemaName name = + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]"); + client.deleteSchemaAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteSchemaTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteSchemaTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSchemaService.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteSchemaAsync(name).get(); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSchemaRequest actualRequest = ((DeleteSchemaRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSchemaExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + String name = "name3373707"; + client.deleteSchemaAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceClientHttpJsonTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..c47deb53a682 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceClientHttpJsonTest.java @@ -0,0 +1,189 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import static com.google.cloud.discoveryengine.v1alpha.SearchServiceClient.SearchPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.discoveryengine.v1alpha.stub.HttpJsonSearchServiceStub; +import com.google.common.collect.Lists; +import com.google.protobuf.Value; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 SearchServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SearchServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSearchServiceStub.getMethodDescriptors(), + SearchServiceSettings.getDefaultEndpoint()); + SearchServiceSettings settings = + SearchServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SearchServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SearchServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void searchTest() throws Exception { + SearchResponse.SearchResult responsesElement = SearchResponse.SearchResult.newBuilder().build(); + SearchResponse expectedResponse = + SearchResponse.newBuilder() + .setNextPageToken("") + .addAllResults(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + SearchRequest request = + SearchRequest.newBuilder() + .setServingConfig( + ServingConfigName.ofProjectLocationDataStoreServingConfigName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]") + .toString()) + .setBranch( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setQuery("query107944136") + .setImageQuery(SearchRequest.ImageQuery.newBuilder().build()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOffset(-1019779949) + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .setUserInfo(UserInfo.newBuilder().build()) + .addAllFacetSpecs(new ArrayList()) + .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) + .putAllParams(new HashMap()) + .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) + .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) + .setUserPseudoId("userPseudoId-1155274652") + .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build()) + .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build()) + .setRankingExpression("rankingExpression2110320494") + .setSafeSearch(true) + .putAllUserLabels(new HashMap()) + .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 = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SearchRequest request = + SearchRequest.newBuilder() + .setServingConfig( + ServingConfigName.ofProjectLocationDataStoreServingConfigName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]") + .toString()) + .setBranch( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setQuery("query107944136") + .setImageQuery(SearchRequest.ImageQuery.newBuilder().build()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOffset(-1019779949) + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .setUserInfo(UserInfo.newBuilder().build()) + .addAllFacetSpecs(new ArrayList()) + .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) + .putAllParams(new HashMap()) + .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) + .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) + .setUserPseudoId("userPseudoId-1155274652") + .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build()) + .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build()) + .setRankingExpression("rankingExpression2110320494") + .setSafeSearch(true) + .putAllUserLabels(new HashMap()) + .build(); + client.search(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceClientTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceClientTest.java new file mode 100644 index 000000000000..426aab56f828 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceClientTest.java @@ -0,0 +1,209 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import static com.google.cloud.discoveryengine.v1alpha.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 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 SearchServiceClientTest { + private static MockLocations mockLocations; + private static MockSearchService mockSearchService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private SearchServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSearchService = new MockSearchService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSearchService, mockLocations)); + 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() + .setServingConfig( + ServingConfigName.ofProjectLocationDataStoreServingConfigName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]") + .toString()) + .setBranch( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setQuery("query107944136") + .setImageQuery(SearchRequest.ImageQuery.newBuilder().build()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOffset(-1019779949) + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .setUserInfo(UserInfo.newBuilder().build()) + .addAllFacetSpecs(new ArrayList()) + .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) + .putAllParams(new HashMap()) + .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) + .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) + .setUserPseudoId("userPseudoId-1155274652") + .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build()) + .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build()) + .setRankingExpression("rankingExpression2110320494") + .setSafeSearch(true) + .putAllUserLabels(new HashMap()) + .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.getServingConfig(), actualRequest.getServingConfig()); + Assert.assertEquals(request.getBranch(), actualRequest.getBranch()); + Assert.assertEquals(request.getQuery(), actualRequest.getQuery()); + Assert.assertEquals(request.getImageQuery(), actualRequest.getImageQuery()); + 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.getOrderBy(), actualRequest.getOrderBy()); + Assert.assertEquals(request.getUserInfo(), actualRequest.getUserInfo()); + Assert.assertEquals(request.getFacetSpecsList(), actualRequest.getFacetSpecsList()); + Assert.assertEquals(request.getBoostSpec(), actualRequest.getBoostSpec()); + Assert.assertEquals(request.getParamsMap(), actualRequest.getParamsMap()); + Assert.assertEquals(request.getQueryExpansionSpec(), actualRequest.getQueryExpansionSpec()); + Assert.assertEquals(request.getSpellCorrectionSpec(), actualRequest.getSpellCorrectionSpec()); + Assert.assertEquals(request.getUserPseudoId(), actualRequest.getUserPseudoId()); + Assert.assertEquals(request.getContentSearchSpec(), actualRequest.getContentSearchSpec()); + Assert.assertEquals(request.getEmbeddingSpec(), actualRequest.getEmbeddingSpec()); + Assert.assertEquals(request.getRankingExpression(), actualRequest.getRankingExpression()); + Assert.assertEquals(request.getSafeSearch(), actualRequest.getSafeSearch()); + Assert.assertEquals(request.getUserLabelsMap(), actualRequest.getUserLabelsMap()); + 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() + .setServingConfig( + ServingConfigName.ofProjectLocationDataStoreServingConfigName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]") + .toString()) + .setBranch( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setQuery("query107944136") + .setImageQuery(SearchRequest.ImageQuery.newBuilder().build()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOffset(-1019779949) + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .setUserInfo(UserInfo.newBuilder().build()) + .addAllFacetSpecs(new ArrayList()) + .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) + .putAllParams(new HashMap()) + .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) + .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) + .setUserPseudoId("userPseudoId-1155274652") + .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build()) + .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build()) + .setRankingExpression("rankingExpression2110320494") + .setSafeSearch(true) + .putAllUserLabels(new HashMap()) + .build(); + client.search(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceClientHttpJsonTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..2844e1d5bafc --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceClientHttpJsonTest.java @@ -0,0 +1,140 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.discoveryengine.v1alpha.stub.HttpJsonSiteSearchEngineServiceStub; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SiteSearchEngineServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SiteSearchEngineServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSiteSearchEngineServiceStub.getMethodDescriptors(), + SiteSearchEngineServiceSettings.getDefaultEndpoint()); + SiteSearchEngineServiceSettings settings = + SiteSearchEngineServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SiteSearchEngineServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SiteSearchEngineServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void recrawlUrisTest() throws Exception { + RecrawlUrisResponse expectedResponse = + RecrawlUrisResponse.newBuilder() + .addAllFailureSamples(new ArrayList()) + .addAllFailedUris(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("recrawlUrisTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + RecrawlUrisRequest request = + RecrawlUrisRequest.newBuilder() + .setSiteSearchEngine( + SiteSearchEngineName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .addAllUris(new ArrayList()) + .build(); + + RecrawlUrisResponse actualResponse = client.recrawlUrisAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void recrawlUrisExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RecrawlUrisRequest request = + RecrawlUrisRequest.newBuilder() + .setSiteSearchEngine( + SiteSearchEngineName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .addAllUris(new ArrayList()) + .build(); + client.recrawlUrisAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceClientTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceClientTest.java new file mode 100644 index 000000000000..6307a473e5d0 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceClientTest.java @@ -0,0 +1,147 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +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 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 SiteSearchEngineServiceClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSiteSearchEngineService mockSiteSearchEngineService; + private LocalChannelProvider channelProvider; + private SiteSearchEngineServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSiteSearchEngineService = new MockSiteSearchEngineService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSiteSearchEngineService, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SiteSearchEngineServiceSettings settings = + SiteSearchEngineServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SiteSearchEngineServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void recrawlUrisTest() throws Exception { + RecrawlUrisResponse expectedResponse = + RecrawlUrisResponse.newBuilder() + .addAllFailureSamples(new ArrayList()) + .addAllFailedUris(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("recrawlUrisTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSiteSearchEngineService.addResponse(resultOperation); + + RecrawlUrisRequest request = + RecrawlUrisRequest.newBuilder() + .setSiteSearchEngine( + SiteSearchEngineName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .addAllUris(new ArrayList()) + .build(); + + RecrawlUrisResponse actualResponse = client.recrawlUrisAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSiteSearchEngineService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RecrawlUrisRequest actualRequest = ((RecrawlUrisRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getSiteSearchEngine(), actualRequest.getSiteSearchEngine()); + Assert.assertEquals(request.getUrisList(), actualRequest.getUrisList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void recrawlUrisExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSiteSearchEngineService.addException(exception); + + try { + RecrawlUrisRequest request = + RecrawlUrisRequest.newBuilder() + .setSiteSearchEngine( + SiteSearchEngineName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .addAllUris(new ArrayList()) + .build(); + client.recrawlUrisAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceClientHttpJsonTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..3cdebe60a875 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceClientHttpJsonTest.java @@ -0,0 +1,350 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.HttpBody; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.discoveryengine.v1alpha.stub.HttpJsonUserEventServiceStub; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Timestamp; +import com.google.rpc.Status; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class UserEventServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static UserEventServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonUserEventServiceStub.getMethodDescriptors(), + UserEventServiceSettings.getDefaultEndpoint()); + UserEventServiceSettings settings = + UserEventServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + UserEventServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = UserEventServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void writeUserEventTest() throws Exception { + UserEvent expectedResponse = + UserEvent.newBuilder() + .setEventType("eventType31430900") + .setUserPseudoId("userPseudoId-1155274652") + .setEventTime(Timestamp.newBuilder().build()) + .setUserInfo(UserInfo.newBuilder().build()) + .setDirectUserRequest(true) + .setSessionId("sessionId607796817") + .setPageInfo(PageInfo.newBuilder().build()) + .setAttributionToken("attributionToken104706234") + .setFilter("filter-1274492040") + .addAllDocuments(new ArrayList()) + .setPanel(PanelInfo.newBuilder().build()) + .setSearchInfo(SearchInfo.newBuilder().build()) + .setCompletionInfo(CompletionInfo.newBuilder().build()) + .setTransactionInfo(TransactionInfo.newBuilder().build()) + .addAllTagIds(new ArrayList()) + .addAllPromotionIds(new ArrayList()) + .putAllAttributes(new HashMap()) + .setMediaInfo(MediaInfo.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + WriteUserEventRequest request = + WriteUserEventRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setUserEvent(UserEvent.newBuilder().build()) + .build(); + + UserEvent actualResponse = client.writeUserEvent(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void writeUserEventExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WriteUserEventRequest request = + WriteUserEventRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .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(); + mockService.addResponse(expectedResponse); + + CollectUserEventRequest request = + CollectUserEventRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setUserEvent("userEvent315571599") + .setUri("uri116076") + .setEts(100772) + .build(); + + HttpBody actualResponse = client.collectUserEvent(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void collectUserEventExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CollectUserEventRequest request = + CollectUserEventRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .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().setPurgeCount(575305851).build(); + Operation resultOperation = + Operation.newBuilder() + .setName("purgeUserEventsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + PurgeUserEventsRequest request = + PurgeUserEventsRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setFilter("filter-1274492040") + .setForce(true) + .build(); + + PurgeUserEventsResponse actualResponse = client.purgeUserEventsAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void purgeUserEventsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PurgeUserEventsRequest request = + PurgeUserEventsRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setFilter("filter-1274492040") + .setForce(true) + .build(); + client.purgeUserEventsAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void importUserEventsTest() throws Exception { + ImportUserEventsResponse expectedResponse = + ImportUserEventsResponse.newBuilder() + .addAllErrorSamples(new ArrayList()) + .setErrorConfig(ImportErrorConfig.newBuilder().build()) + .setJoinedEventsCount(-720068705) + .setUnjoinedEventsCount(512159846) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("importUserEventsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ImportUserEventsRequest request = + ImportUserEventsRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setErrorConfig(ImportErrorConfig.newBuilder().build()) + .build(); + + ImportUserEventsResponse actualResponse = client.importUserEventsAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void importUserEventsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ImportUserEventsRequest request = + ImportUserEventsRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setErrorConfig(ImportErrorConfig.newBuilder().build()) + .build(); + client.importUserEventsAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } +} diff --git a/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceClientTest.java b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceClientTest.java new file mode 100644 index 000000000000..29ac02c829b4 --- /dev/null +++ b/java-discoveryengine/google-cloud-discoveryengine/src/test/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceClientTest.java @@ -0,0 +1,350 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +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 MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockUserEventService mockUserEventService; + private LocalChannelProvider channelProvider; + private UserEventServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockUserEventService = new MockUserEventService(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockUserEventService, mockLocations)); + 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") + .setUserPseudoId("userPseudoId-1155274652") + .setEventTime(Timestamp.newBuilder().build()) + .setUserInfo(UserInfo.newBuilder().build()) + .setDirectUserRequest(true) + .setSessionId("sessionId607796817") + .setPageInfo(PageInfo.newBuilder().build()) + .setAttributionToken("attributionToken104706234") + .setFilter("filter-1274492040") + .addAllDocuments(new ArrayList()) + .setPanel(PanelInfo.newBuilder().build()) + .setSearchInfo(SearchInfo.newBuilder().build()) + .setCompletionInfo(CompletionInfo.newBuilder().build()) + .setTransactionInfo(TransactionInfo.newBuilder().build()) + .addAllTagIds(new ArrayList()) + .addAllPromotionIds(new ArrayList()) + .putAllAttributes(new HashMap()) + .setMediaInfo(MediaInfo.newBuilder().build()) + .build(); + mockUserEventService.addResponse(expectedResponse); + + WriteUserEventRequest request = + WriteUserEventRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .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( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .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( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .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( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .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().setPurgeCount(575305851).build(); + Operation resultOperation = + Operation.newBuilder() + .setName("purgeUserEventsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockUserEventService.addResponse(resultOperation); + + PurgeUserEventsRequest request = + PurgeUserEventsRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .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( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .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()) + .setErrorConfig(ImportErrorConfig.newBuilder().build()) + .setJoinedEventsCount(-720068705) + .setUnjoinedEventsCount(512159846) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("importUserEventsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockUserEventService.addResponse(resultOperation); + + ImportUserEventsRequest request = + ImportUserEventsRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setErrorConfig(ImportErrorConfig.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.getInlineSource(), actualRequest.getInlineSource()); + Assert.assertEquals(request.getGcsSource(), actualRequest.getGcsSource()); + Assert.assertEquals(request.getBigquerySource(), actualRequest.getBigquerySource()); + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getErrorConfig(), actualRequest.getErrorConfig()); + 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( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setErrorConfig(ImportErrorConfig.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()); + } + } +} diff --git a/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/pom.xml b/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/pom.xml new file mode 100644 index 000000000000..1bdf0d544573 --- /dev/null +++ b/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-discoveryengine-v1alpha + 0.24.0 + grpc-google-cloud-discoveryengine-v1alpha + GRPC library for google-cloud-discoveryengine + + com.google.cloud + google-cloud-discoveryengine-parent + 0.24.0 + + + + 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-discoveryengine-v1alpha + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceGrpc.java b/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceGrpc.java new file mode 100644 index 000000000000..99a72be8814c --- /dev/null +++ b/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceGrpc.java @@ -0,0 +1,382 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.discoveryengine.v1alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for Auto-Completion.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/discoveryengine/v1alpha/completion_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class CompletionServiceGrpc { + + private CompletionServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.discoveryengine.v1alpha.CompletionService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest, + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse> + getCompleteQueryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CompleteQuery", + requestType = com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest.class, + responseType = com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest, + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse> + getCompleteQueryMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest, + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.CompleteQueryRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CompletionServiceMethodDescriptorSupplier("CompleteQuery")) + .build(); + } + } + } + return getCompleteQueryMethod; + } + + /** 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); + } + + /** + * + * + *
+   * Service for Auto-Completion.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Completes the specified user input with keyword suggestions.
+     * 
+ */ + default void completeQuery( + com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCompleteQueryMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service CompletionService. + * + *
+   * Service for Auto-Completion.
+   * 
+ */ + public abstract static class CompletionServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return CompletionServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service CompletionService. + * + *
+   * Service for Auto-Completion.
+   * 
+ */ + 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 user input with keyword suggestions.
+     * 
+ */ + public void completeQuery( + com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCompleteQueryMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service CompletionService. + * + *
+   * Service for Auto-Completion.
+   * 
+ */ + 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 user input with keyword suggestions.
+     * 
+ */ + public com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse completeQuery( + com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCompleteQueryMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service CompletionService. + * + *
+   * Service for Auto-Completion.
+   * 
+ */ + 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 user input with keyword suggestions.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse> + completeQuery(com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCompleteQueryMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_COMPLETE_QUERY = 0; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_COMPLETE_QUERY: + serviceImpl.completeQuery( + (com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse>) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCompleteQueryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest, + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse>( + service, METHODID_COMPLETE_QUERY))) + .build(); + } + + 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.discoveryengine.v1alpha.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 java.lang.String methodName; + + CompletionServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (CompletionServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CompletionServiceFileDescriptorSupplier()) + .addMethod(getCompleteQueryMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceGrpc.java b/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceGrpc.java new file mode 100644 index 000000000000..bacf8e915512 --- /dev/null +++ b/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceGrpc.java @@ -0,0 +1,1057 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.discoveryengine.v1alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for conversational search.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/discoveryengine/v1alpha/conversational_search_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class ConversationalSearchServiceGrpc { + + private ConversationalSearchServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.discoveryengine.v1alpha.ConversationalSearchService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest, + com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse> + getConverseConversationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ConverseConversation", + requestType = com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest.class, + responseType = com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest, + com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse> + getConverseConversationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest, + com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse> + getConverseConversationMethod; + if ((getConverseConversationMethod = + ConversationalSearchServiceGrpc.getConverseConversationMethod) + == null) { + synchronized (ConversationalSearchServiceGrpc.class) { + if ((getConverseConversationMethod = + ConversationalSearchServiceGrpc.getConverseConversationMethod) + == null) { + ConversationalSearchServiceGrpc.getConverseConversationMethod = + getConverseConversationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ConverseConversation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ConversationalSearchServiceMethodDescriptorSupplier( + "ConverseConversation")) + .build(); + } + } + } + return getConverseConversationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest, + com.google.cloud.discoveryengine.v1alpha.Conversation> + getCreateConversationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateConversation", + requestType = com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest.class, + responseType = com.google.cloud.discoveryengine.v1alpha.Conversation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest, + com.google.cloud.discoveryengine.v1alpha.Conversation> + getCreateConversationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest, + com.google.cloud.discoveryengine.v1alpha.Conversation> + getCreateConversationMethod; + if ((getCreateConversationMethod = ConversationalSearchServiceGrpc.getCreateConversationMethod) + == null) { + synchronized (ConversationalSearchServiceGrpc.class) { + if ((getCreateConversationMethod = + ConversationalSearchServiceGrpc.getCreateConversationMethod) + == null) { + ConversationalSearchServiceGrpc.getCreateConversationMethod = + getCreateConversationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateConversation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.Conversation + .getDefaultInstance())) + .setSchemaDescriptor( + new ConversationalSearchServiceMethodDescriptorSupplier( + "CreateConversation")) + .build(); + } + } + } + return getCreateConversationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest, + com.google.protobuf.Empty> + getDeleteConversationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteConversation", + requestType = com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest, + com.google.protobuf.Empty> + getDeleteConversationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest, + com.google.protobuf.Empty> + getDeleteConversationMethod; + if ((getDeleteConversationMethod = ConversationalSearchServiceGrpc.getDeleteConversationMethod) + == null) { + synchronized (ConversationalSearchServiceGrpc.class) { + if ((getDeleteConversationMethod = + ConversationalSearchServiceGrpc.getDeleteConversationMethod) + == null) { + ConversationalSearchServiceGrpc.getDeleteConversationMethod = + getDeleteConversationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteConversation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ConversationalSearchServiceMethodDescriptorSupplier( + "DeleteConversation")) + .build(); + } + } + } + return getDeleteConversationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest, + com.google.cloud.discoveryengine.v1alpha.Conversation> + getUpdateConversationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateConversation", + requestType = com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest.class, + responseType = com.google.cloud.discoveryengine.v1alpha.Conversation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest, + com.google.cloud.discoveryengine.v1alpha.Conversation> + getUpdateConversationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest, + com.google.cloud.discoveryengine.v1alpha.Conversation> + getUpdateConversationMethod; + if ((getUpdateConversationMethod = ConversationalSearchServiceGrpc.getUpdateConversationMethod) + == null) { + synchronized (ConversationalSearchServiceGrpc.class) { + if ((getUpdateConversationMethod = + ConversationalSearchServiceGrpc.getUpdateConversationMethod) + == null) { + ConversationalSearchServiceGrpc.getUpdateConversationMethod = + getUpdateConversationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateConversation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.Conversation + .getDefaultInstance())) + .setSchemaDescriptor( + new ConversationalSearchServiceMethodDescriptorSupplier( + "UpdateConversation")) + .build(); + } + } + } + return getUpdateConversationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.GetConversationRequest, + com.google.cloud.discoveryengine.v1alpha.Conversation> + getGetConversationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetConversation", + requestType = com.google.cloud.discoveryengine.v1alpha.GetConversationRequest.class, + responseType = com.google.cloud.discoveryengine.v1alpha.Conversation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.GetConversationRequest, + com.google.cloud.discoveryengine.v1alpha.Conversation> + getGetConversationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.GetConversationRequest, + com.google.cloud.discoveryengine.v1alpha.Conversation> + getGetConversationMethod; + if ((getGetConversationMethod = ConversationalSearchServiceGrpc.getGetConversationMethod) + == null) { + synchronized (ConversationalSearchServiceGrpc.class) { + if ((getGetConversationMethod = ConversationalSearchServiceGrpc.getGetConversationMethod) + == null) { + ConversationalSearchServiceGrpc.getGetConversationMethod = + getGetConversationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetConversation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.GetConversationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.Conversation + .getDefaultInstance())) + .setSchemaDescriptor( + new ConversationalSearchServiceMethodDescriptorSupplier( + "GetConversation")) + .build(); + } + } + } + return getGetConversationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest, + com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse> + getListConversationsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListConversations", + requestType = com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest.class, + responseType = com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest, + com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse> + getListConversationsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest, + com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse> + getListConversationsMethod; + if ((getListConversationsMethod = ConversationalSearchServiceGrpc.getListConversationsMethod) + == null) { + synchronized (ConversationalSearchServiceGrpc.class) { + if ((getListConversationsMethod = + ConversationalSearchServiceGrpc.getListConversationsMethod) + == null) { + ConversationalSearchServiceGrpc.getListConversationsMethod = + getListConversationsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListConversations")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ConversationalSearchServiceMethodDescriptorSupplier( + "ListConversations")) + .build(); + } + } + } + return getListConversationsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ConversationalSearchServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ConversationalSearchServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConversationalSearchServiceStub(channel, callOptions); + } + }; + return ConversationalSearchServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ConversationalSearchServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ConversationalSearchServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConversationalSearchServiceBlockingStub(channel, callOptions); + } + }; + return ConversationalSearchServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ConversationalSearchServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ConversationalSearchServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConversationalSearchServiceFutureStub(channel, callOptions); + } + }; + return ConversationalSearchServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for conversational search.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Converses a conversation.
+     * 
+ */ + default void converseConversation( + com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getConverseConversationMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a Conversation.
+     * If the [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+     * create already exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + default void createConversation( + com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateConversationMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a Conversation.
+     * If the [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+     * delete does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + default void deleteConversation( + com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteConversationMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a Conversation.
+     * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] action
+     * type cannot be changed. If the
+     * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to update
+     * does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + default void updateConversation( + com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateConversationMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a Conversation.
+     * 
+ */ + default void getConversation( + com.google.cloud.discoveryengine.v1alpha.GetConversationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetConversationMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all Conversations by their parent
+     * [DataStore][google.cloud.discoveryengine.v1alpha.DataStore].
+     * 
+ */ + default void listConversations( + com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListConversationsMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service ConversationalSearchService. + * + *
+   * Service for conversational search.
+   * 
+ */ + public abstract static class ConversationalSearchServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return ConversationalSearchServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service ConversationalSearchService. + * + *
+   * Service for conversational search.
+   * 
+ */ + public static final class ConversationalSearchServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private ConversationalSearchServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ConversationalSearchServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConversationalSearchServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Converses a conversation.
+     * 
+ */ + public void converseConversation( + com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getConverseConversationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a Conversation.
+     * If the [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+     * create already exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + public void createConversation( + com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateConversationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a Conversation.
+     * If the [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+     * delete does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public void deleteConversation( + com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteConversationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a Conversation.
+     * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] action
+     * type cannot be changed. If the
+     * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to update
+     * does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public void updateConversation( + com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateConversationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a Conversation.
+     * 
+ */ + public void getConversation( + com.google.cloud.discoveryengine.v1alpha.GetConversationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetConversationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all Conversations by their parent
+     * [DataStore][google.cloud.discoveryengine.v1alpha.DataStore].
+     * 
+ */ + public void listConversations( + com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListConversationsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service ConversationalSearchService. + * + *
+   * Service for conversational search.
+   * 
+ */ + public static final class ConversationalSearchServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ConversationalSearchServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ConversationalSearchServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConversationalSearchServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Converses a conversation.
+     * 
+ */ + public com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse + converseConversation( + com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getConverseConversationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a Conversation.
+     * If the [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+     * create already exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + public com.google.cloud.discoveryengine.v1alpha.Conversation createConversation( + com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateConversationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a Conversation.
+     * If the [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+     * delete does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public com.google.protobuf.Empty deleteConversation( + com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteConversationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a Conversation.
+     * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] action
+     * type cannot be changed. If the
+     * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to update
+     * does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public com.google.cloud.discoveryengine.v1alpha.Conversation updateConversation( + com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateConversationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a Conversation.
+     * 
+ */ + public com.google.cloud.discoveryengine.v1alpha.Conversation getConversation( + com.google.cloud.discoveryengine.v1alpha.GetConversationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetConversationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all Conversations by their parent
+     * [DataStore][google.cloud.discoveryengine.v1alpha.DataStore].
+     * 
+ */ + public com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse listConversations( + com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListConversationsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * ConversationalSearchService. + * + *
+   * Service for conversational search.
+   * 
+ */ + public static final class ConversationalSearchServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ConversationalSearchServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ConversationalSearchServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConversationalSearchServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Converses a conversation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse> + converseConversation( + com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getConverseConversationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a Conversation.
+     * If the [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+     * create already exists, an ALREADY_EXISTS error is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.discoveryengine.v1alpha.Conversation> + createConversation( + com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateConversationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a Conversation.
+     * If the [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+     * delete does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteConversation( + com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteConversationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a Conversation.
+     * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] action
+     * type cannot be changed. If the
+     * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to update
+     * does not exist, a NOT_FOUND error is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.discoveryengine.v1alpha.Conversation> + updateConversation( + com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateConversationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a Conversation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.discoveryengine.v1alpha.Conversation> + getConversation(com.google.cloud.discoveryengine.v1alpha.GetConversationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetConversationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all Conversations by their parent
+     * [DataStore][google.cloud.discoveryengine.v1alpha.DataStore].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse> + listConversations( + com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListConversationsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CONVERSE_CONVERSATION = 0; + private static final int METHODID_CREATE_CONVERSATION = 1; + private static final int METHODID_DELETE_CONVERSATION = 2; + private static final int METHODID_UPDATE_CONVERSATION = 3; + private static final int METHODID_GET_CONVERSATION = 4; + private static final int METHODID_LIST_CONVERSATIONS = 5; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CONVERSE_CONVERSATION: + serviceImpl.converseConversation( + (com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse>) + responseObserver); + break; + case METHODID_CREATE_CONVERSATION: + serviceImpl.createConversation( + (com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_CONVERSATION: + serviceImpl.deleteConversation( + (com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_CONVERSATION: + serviceImpl.updateConversation( + (com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_CONVERSATION: + serviceImpl.getConversation( + (com.google.cloud.discoveryengine.v1alpha.GetConversationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_CONVERSATIONS: + serviceImpl.listConversations( + (com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse>) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getConverseConversationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest, + com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse>( + service, METHODID_CONVERSE_CONVERSATION))) + .addMethod( + getCreateConversationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest, + com.google.cloud.discoveryengine.v1alpha.Conversation>( + service, METHODID_CREATE_CONVERSATION))) + .addMethod( + getDeleteConversationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_CONVERSATION))) + .addMethod( + getUpdateConversationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest, + com.google.cloud.discoveryengine.v1alpha.Conversation>( + service, METHODID_UPDATE_CONVERSATION))) + .addMethod( + getGetConversationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.GetConversationRequest, + com.google.cloud.discoveryengine.v1alpha.Conversation>( + service, METHODID_GET_CONVERSATION))) + .addMethod( + getListConversationsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest, + com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse>( + service, METHODID_LIST_CONVERSATIONS))) + .build(); + } + + private abstract static class ConversationalSearchServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ConversationalSearchServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ConversationalSearchService"); + } + } + + private static final class ConversationalSearchServiceFileDescriptorSupplier + extends ConversationalSearchServiceBaseDescriptorSupplier { + ConversationalSearchServiceFileDescriptorSupplier() {} + } + + private static final class ConversationalSearchServiceMethodDescriptorSupplier + extends ConversationalSearchServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + ConversationalSearchServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (ConversationalSearchServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ConversationalSearchServiceFileDescriptorSupplier()) + .addMethod(getConverseConversationMethod()) + .addMethod(getCreateConversationMethod()) + .addMethod(getDeleteConversationMethod()) + .addMethod(getUpdateConversationMethod()) + .addMethod(getGetConversationMethod()) + .addMethod(getListConversationsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceGrpc.java b/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceGrpc.java new file mode 100644 index 000000000000..d5a97f9787ae --- /dev/null +++ b/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceGrpc.java @@ -0,0 +1,1174 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.discoveryengine.v1alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for ingesting
+ * [Document][google.cloud.discoveryengine.v1alpha.Document] information of the
+ * customer's website.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/discoveryengine/v1alpha/document_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class DocumentServiceGrpc { + + private DocumentServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.discoveryengine.v1alpha.DocumentService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest, + com.google.cloud.discoveryengine.v1alpha.Document> + getGetDocumentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetDocument", + requestType = com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest.class, + responseType = com.google.cloud.discoveryengine.v1alpha.Document.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest, + com.google.cloud.discoveryengine.v1alpha.Document> + getGetDocumentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest, + com.google.cloud.discoveryengine.v1alpha.Document> + getGetDocumentMethod; + if ((getGetDocumentMethod = DocumentServiceGrpc.getGetDocumentMethod) == null) { + synchronized (DocumentServiceGrpc.class) { + if ((getGetDocumentMethod = DocumentServiceGrpc.getGetDocumentMethod) == null) { + DocumentServiceGrpc.getGetDocumentMethod = + getGetDocumentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetDocument")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.Document + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentServiceMethodDescriptorSupplier("GetDocument")) + .build(); + } + } + } + return getGetDocumentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest, + com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse> + getListDocumentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListDocuments", + requestType = com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest.class, + responseType = com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest, + com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse> + getListDocumentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest, + com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse> + getListDocumentsMethod; + if ((getListDocumentsMethod = DocumentServiceGrpc.getListDocumentsMethod) == null) { + synchronized (DocumentServiceGrpc.class) { + if ((getListDocumentsMethod = DocumentServiceGrpc.getListDocumentsMethod) == null) { + DocumentServiceGrpc.getListDocumentsMethod = + getListDocumentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListDocuments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentServiceMethodDescriptorSupplier("ListDocuments")) + .build(); + } + } + } + return getListDocumentsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest, + com.google.cloud.discoveryengine.v1alpha.Document> + getCreateDocumentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateDocument", + requestType = com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest.class, + responseType = com.google.cloud.discoveryengine.v1alpha.Document.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest, + com.google.cloud.discoveryengine.v1alpha.Document> + getCreateDocumentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest, + com.google.cloud.discoveryengine.v1alpha.Document> + getCreateDocumentMethod; + if ((getCreateDocumentMethod = DocumentServiceGrpc.getCreateDocumentMethod) == null) { + synchronized (DocumentServiceGrpc.class) { + if ((getCreateDocumentMethod = DocumentServiceGrpc.getCreateDocumentMethod) == null) { + DocumentServiceGrpc.getCreateDocumentMethod = + getCreateDocumentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateDocument")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.Document + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentServiceMethodDescriptorSupplier("CreateDocument")) + .build(); + } + } + } + return getCreateDocumentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest, + com.google.cloud.discoveryengine.v1alpha.Document> + getUpdateDocumentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateDocument", + requestType = com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.class, + responseType = com.google.cloud.discoveryengine.v1alpha.Document.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest, + com.google.cloud.discoveryengine.v1alpha.Document> + getUpdateDocumentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest, + com.google.cloud.discoveryengine.v1alpha.Document> + getUpdateDocumentMethod; + if ((getUpdateDocumentMethod = DocumentServiceGrpc.getUpdateDocumentMethod) == null) { + synchronized (DocumentServiceGrpc.class) { + if ((getUpdateDocumentMethod = DocumentServiceGrpc.getUpdateDocumentMethod) == null) { + DocumentServiceGrpc.getUpdateDocumentMethod = + getUpdateDocumentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateDocument")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.Document + .getDefaultInstance())) + .setSchemaDescriptor( + new DocumentServiceMethodDescriptorSupplier("UpdateDocument")) + .build(); + } + } + } + return getUpdateDocumentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest, com.google.protobuf.Empty> + getDeleteDocumentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteDocument", + requestType = com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest, com.google.protobuf.Empty> + getDeleteDocumentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest, + com.google.protobuf.Empty> + getDeleteDocumentMethod; + if ((getDeleteDocumentMethod = DocumentServiceGrpc.getDeleteDocumentMethod) == null) { + synchronized (DocumentServiceGrpc.class) { + if ((getDeleteDocumentMethod = DocumentServiceGrpc.getDeleteDocumentMethod) == null) { + DocumentServiceGrpc.getDeleteDocumentMethod = + getDeleteDocumentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteDocument")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentServiceMethodDescriptorSupplier("DeleteDocument")) + .build(); + } + } + } + return getDeleteDocumentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest, + com.google.longrunning.Operation> + getImportDocumentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ImportDocuments", + requestType = com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest, + com.google.longrunning.Operation> + getImportDocumentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest, + com.google.longrunning.Operation> + getImportDocumentsMethod; + if ((getImportDocumentsMethod = DocumentServiceGrpc.getImportDocumentsMethod) == null) { + synchronized (DocumentServiceGrpc.class) { + if ((getImportDocumentsMethod = DocumentServiceGrpc.getImportDocumentsMethod) == null) { + DocumentServiceGrpc.getImportDocumentsMethod = + getImportDocumentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ImportDocuments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentServiceMethodDescriptorSupplier("ImportDocuments")) + .build(); + } + } + } + return getImportDocumentsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest, + com.google.longrunning.Operation> + getPurgeDocumentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PurgeDocuments", + requestType = com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest, + com.google.longrunning.Operation> + getPurgeDocumentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest, + com.google.longrunning.Operation> + getPurgeDocumentsMethod; + if ((getPurgeDocumentsMethod = DocumentServiceGrpc.getPurgeDocumentsMethod) == null) { + synchronized (DocumentServiceGrpc.class) { + if ((getPurgeDocumentsMethod = DocumentServiceGrpc.getPurgeDocumentsMethod) == null) { + DocumentServiceGrpc.getPurgeDocumentsMethod = + getPurgeDocumentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PurgeDocuments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DocumentServiceMethodDescriptorSupplier("PurgeDocuments")) + .build(); + } + } + } + return getPurgeDocumentsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static DocumentServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentServiceStub(channel, callOptions); + } + }; + return DocumentServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static DocumentServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentServiceBlockingStub(channel, callOptions); + } + }; + return DocumentServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static DocumentServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DocumentServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentServiceFutureStub(channel, callOptions); + } + }; + return DocumentServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for ingesting
+   * [Document][google.cloud.discoveryengine.v1alpha.Document] information of the
+   * customer's website.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Gets a [Document][google.cloud.discoveryengine.v1alpha.Document].
+     * 
+ */ + default void getDocument( + com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetDocumentMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a list of [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+     * 
+ */ + default void listDocuments( + com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListDocumentsMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a [Document][google.cloud.discoveryengine.v1alpha.Document].
+     * 
+ */ + default void createDocument( + com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateDocumentMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a [Document][google.cloud.discoveryengine.v1alpha.Document].
+     * 
+ */ + default void updateDocument( + com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateDocumentMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a [Document][google.cloud.discoveryengine.v1alpha.Document].
+     * 
+ */ + default void deleteDocument( + com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteDocumentMethod(), responseObserver); + } + + /** + * + * + *
+     * Bulk import of multiple
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s. Request
+     * processing may be synchronous. Non-existing items will be created.
+     * Note: It is possible for a subset of the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s to be
+     * successfully updated.
+     * 
+ */ + default void importDocuments( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getImportDocumentsMethod(), responseObserver); + } + + /** + * + * + *
+     * Permanently deletes all selected
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s in a branch.
+     * This process is asynchronous. Depending on the number of
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s to be deleted,
+     * this operation can take hours to complete. Before the delete operation
+     * completes, some [Document][google.cloud.discoveryengine.v1alpha.Document]s
+     * might still be returned by
+     * [DocumentService.GetDocument][google.cloud.discoveryengine.v1alpha.DocumentService.GetDocument]
+     * or
+     * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments].
+     * To get a list of the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s to be deleted,
+     * set
+     * [PurgeDocumentsRequest.force][google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest.force]
+     * to false.
+     * 
+ */ + default void purgeDocuments( + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPurgeDocumentsMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service DocumentService. + * + *
+   * Service for ingesting
+   * [Document][google.cloud.discoveryengine.v1alpha.Document] information of the
+   * customer's website.
+   * 
+ */ + public abstract static class DocumentServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return DocumentServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service DocumentService. + * + *
+   * Service for ingesting
+   * [Document][google.cloud.discoveryengine.v1alpha.Document] information of the
+   * customer's website.
+   * 
+ */ + public static final class DocumentServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private DocumentServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets a [Document][google.cloud.discoveryengine.v1alpha.Document].
+     * 
+ */ + public void getDocument( + com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetDocumentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a list of [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+     * 
+ */ + public void listDocuments( + com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListDocumentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a [Document][google.cloud.discoveryengine.v1alpha.Document].
+     * 
+ */ + public void createDocument( + com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateDocumentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a [Document][google.cloud.discoveryengine.v1alpha.Document].
+     * 
+ */ + public void updateDocument( + com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateDocumentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a [Document][google.cloud.discoveryengine.v1alpha.Document].
+     * 
+ */ + public void deleteDocument( + com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteDocumentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Bulk import of multiple
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s. Request
+     * processing may be synchronous. Non-existing items will be created.
+     * Note: It is possible for a subset of the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s to be
+     * successfully updated.
+     * 
+ */ + public void importDocuments( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getImportDocumentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Permanently deletes all selected
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s in a branch.
+     * This process is asynchronous. Depending on the number of
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s to be deleted,
+     * this operation can take hours to complete. Before the delete operation
+     * completes, some [Document][google.cloud.discoveryengine.v1alpha.Document]s
+     * might still be returned by
+     * [DocumentService.GetDocument][google.cloud.discoveryengine.v1alpha.DocumentService.GetDocument]
+     * or
+     * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments].
+     * To get a list of the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s to be deleted,
+     * set
+     * [PurgeDocumentsRequest.force][google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest.force]
+     * to false.
+     * 
+ */ + public void purgeDocuments( + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPurgeDocumentsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service DocumentService. + * + *
+   * Service for ingesting
+   * [Document][google.cloud.discoveryengine.v1alpha.Document] information of the
+   * customer's website.
+   * 
+ */ + public static final class DocumentServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private DocumentServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets a [Document][google.cloud.discoveryengine.v1alpha.Document].
+     * 
+ */ + public com.google.cloud.discoveryengine.v1alpha.Document getDocument( + com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetDocumentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a list of [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+     * 
+ */ + public com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse listDocuments( + com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListDocumentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a [Document][google.cloud.discoveryengine.v1alpha.Document].
+     * 
+ */ + public com.google.cloud.discoveryengine.v1alpha.Document createDocument( + com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateDocumentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a [Document][google.cloud.discoveryengine.v1alpha.Document].
+     * 
+ */ + public com.google.cloud.discoveryengine.v1alpha.Document updateDocument( + com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateDocumentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a [Document][google.cloud.discoveryengine.v1alpha.Document].
+     * 
+ */ + public com.google.protobuf.Empty deleteDocument( + com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteDocumentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Bulk import of multiple
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s. Request
+     * processing may be synchronous. Non-existing items will be created.
+     * Note: It is possible for a subset of the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s to be
+     * successfully updated.
+     * 
+ */ + public com.google.longrunning.Operation importDocuments( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getImportDocumentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Permanently deletes all selected
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s in a branch.
+     * This process is asynchronous. Depending on the number of
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s to be deleted,
+     * this operation can take hours to complete. Before the delete operation
+     * completes, some [Document][google.cloud.discoveryengine.v1alpha.Document]s
+     * might still be returned by
+     * [DocumentService.GetDocument][google.cloud.discoveryengine.v1alpha.DocumentService.GetDocument]
+     * or
+     * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments].
+     * To get a list of the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s to be deleted,
+     * set
+     * [PurgeDocumentsRequest.force][google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest.force]
+     * to false.
+     * 
+ */ + public com.google.longrunning.Operation purgeDocuments( + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPurgeDocumentsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service DocumentService. + * + *
+   * Service for ingesting
+   * [Document][google.cloud.discoveryengine.v1alpha.Document] information of the
+   * customer's website.
+   * 
+ */ + public static final class DocumentServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private DocumentServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DocumentServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DocumentServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets a [Document][google.cloud.discoveryengine.v1alpha.Document].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.discoveryengine.v1alpha.Document> + getDocument(com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetDocumentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a list of [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse> + listDocuments(com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListDocumentsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a [Document][google.cloud.discoveryengine.v1alpha.Document].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.discoveryengine.v1alpha.Document> + createDocument(com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateDocumentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a [Document][google.cloud.discoveryengine.v1alpha.Document].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.discoveryengine.v1alpha.Document> + updateDocument(com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateDocumentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a [Document][google.cloud.discoveryengine.v1alpha.Document].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteDocument(com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteDocumentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Bulk import of multiple
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s. Request
+     * processing may be synchronous. Non-existing items will be created.
+     * Note: It is possible for a subset of the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s to be
+     * successfully updated.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + importDocuments(com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getImportDocumentsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Permanently deletes all selected
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s in a branch.
+     * This process is asynchronous. Depending on the number of
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s to be deleted,
+     * this operation can take hours to complete. Before the delete operation
+     * completes, some [Document][google.cloud.discoveryengine.v1alpha.Document]s
+     * might still be returned by
+     * [DocumentService.GetDocument][google.cloud.discoveryengine.v1alpha.DocumentService.GetDocument]
+     * or
+     * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments].
+     * To get a list of the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s to be deleted,
+     * set
+     * [PurgeDocumentsRequest.force][google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest.force]
+     * to false.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + purgeDocuments(com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPurgeDocumentsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_DOCUMENT = 0; + private static final int METHODID_LIST_DOCUMENTS = 1; + private static final int METHODID_CREATE_DOCUMENT = 2; + private static final int METHODID_UPDATE_DOCUMENT = 3; + private static final int METHODID_DELETE_DOCUMENT = 4; + private static final int METHODID_IMPORT_DOCUMENTS = 5; + private static final int METHODID_PURGE_DOCUMENTS = 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 AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GET_DOCUMENT: + serviceImpl.getDocument( + (com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_DOCUMENTS: + serviceImpl.listDocuments( + (com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse>) + responseObserver); + break; + case METHODID_CREATE_DOCUMENT: + serviceImpl.createDocument( + (com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_DOCUMENT: + serviceImpl.updateDocument( + (com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_DOCUMENT: + serviceImpl.deleteDocument( + (com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_IMPORT_DOCUMENTS: + serviceImpl.importDocuments( + (com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_PURGE_DOCUMENTS: + serviceImpl.purgeDocuments( + (com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetDocumentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest, + com.google.cloud.discoveryengine.v1alpha.Document>( + service, METHODID_GET_DOCUMENT))) + .addMethod( + getListDocumentsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest, + com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse>( + service, METHODID_LIST_DOCUMENTS))) + .addMethod( + getCreateDocumentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest, + com.google.cloud.discoveryengine.v1alpha.Document>( + service, METHODID_CREATE_DOCUMENT))) + .addMethod( + getUpdateDocumentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest, + com.google.cloud.discoveryengine.v1alpha.Document>( + service, METHODID_UPDATE_DOCUMENT))) + .addMethod( + getDeleteDocumentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_DOCUMENT))) + .addMethod( + getImportDocumentsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest, + com.google.longrunning.Operation>(service, METHODID_IMPORT_DOCUMENTS))) + .addMethod( + getPurgeDocumentsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest, + com.google.longrunning.Operation>(service, METHODID_PURGE_DOCUMENTS))) + .build(); + } + + private abstract static class DocumentServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + DocumentServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("DocumentService"); + } + } + + private static final class DocumentServiceFileDescriptorSupplier + extends DocumentServiceBaseDescriptorSupplier { + DocumentServiceFileDescriptorSupplier() {} + } + + private static final class DocumentServiceMethodDescriptorSupplier + extends DocumentServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + DocumentServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (DocumentServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new DocumentServiceFileDescriptorSupplier()) + .addMethod(getGetDocumentMethod()) + .addMethod(getListDocumentsMethod()) + .addMethod(getCreateDocumentMethod()) + .addMethod(getUpdateDocumentMethod()) + .addMethod(getDeleteDocumentMethod()) + .addMethod(getImportDocumentsMethod()) + .addMethod(getPurgeDocumentsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceGrpc.java b/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceGrpc.java new file mode 100644 index 000000000000..e4682b4a6e2a --- /dev/null +++ b/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceGrpc.java @@ -0,0 +1,381 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.discoveryengine.v1alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for making recommendations.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/discoveryengine/v1alpha/recommendation_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class RecommendationServiceGrpc { + + private RecommendationServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.discoveryengine.v1alpha.RecommendationService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.RecommendRequest, + com.google.cloud.discoveryengine.v1alpha.RecommendResponse> + getRecommendMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Recommend", + requestType = com.google.cloud.discoveryengine.v1alpha.RecommendRequest.class, + responseType = com.google.cloud.discoveryengine.v1alpha.RecommendResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.RecommendRequest, + com.google.cloud.discoveryengine.v1alpha.RecommendResponse> + getRecommendMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.RecommendRequest, + com.google.cloud.discoveryengine.v1alpha.RecommendResponse> + getRecommendMethod; + if ((getRecommendMethod = RecommendationServiceGrpc.getRecommendMethod) == null) { + synchronized (RecommendationServiceGrpc.class) { + if ((getRecommendMethod = RecommendationServiceGrpc.getRecommendMethod) == null) { + RecommendationServiceGrpc.getRecommendMethod = + getRecommendMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Recommend")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.RecommendRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.RecommendResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new RecommendationServiceMethodDescriptorSupplier("Recommend")) + .build(); + } + } + } + return getRecommendMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static RecommendationServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RecommendationServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RecommendationServiceStub(channel, callOptions); + } + }; + return RecommendationServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static RecommendationServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RecommendationServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RecommendationServiceBlockingStub(channel, callOptions); + } + }; + return RecommendationServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static RecommendationServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RecommendationServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RecommendationServiceFutureStub(channel, callOptions); + } + }; + return RecommendationServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for making recommendations.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Makes a recommendation, which requires a contextual user event.
+     * 
+ */ + default void recommend( + com.google.cloud.discoveryengine.v1alpha.RecommendRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRecommendMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service RecommendationService. + * + *
+   * Service for making recommendations.
+   * 
+ */ + public abstract static class RecommendationServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return RecommendationServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service RecommendationService. + * + *
+   * Service for making recommendations.
+   * 
+ */ + public static final class RecommendationServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private RecommendationServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RecommendationServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RecommendationServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Makes a recommendation, which requires a contextual user event.
+     * 
+ */ + public void recommend( + com.google.cloud.discoveryengine.v1alpha.RecommendRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRecommendMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service RecommendationService. + * + *
+   * Service for making recommendations.
+   * 
+ */ + public static final class RecommendationServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private RecommendationServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RecommendationServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RecommendationServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Makes a recommendation, which requires a contextual user event.
+     * 
+ */ + public com.google.cloud.discoveryengine.v1alpha.RecommendResponse recommend( + com.google.cloud.discoveryengine.v1alpha.RecommendRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRecommendMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * RecommendationService. + * + *
+   * Service for making recommendations.
+   * 
+ */ + public static final class RecommendationServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private RecommendationServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RecommendationServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RecommendationServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Makes a recommendation, which requires a contextual user event.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.discoveryengine.v1alpha.RecommendResponse> + recommend(com.google.cloud.discoveryengine.v1alpha.RecommendRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRecommendMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_RECOMMEND = 0; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_RECOMMEND: + serviceImpl.recommend( + (com.google.cloud.discoveryengine.v1alpha.RecommendRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.discoveryengine.v1alpha.RecommendResponse>) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getRecommendMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.RecommendRequest, + com.google.cloud.discoveryengine.v1alpha.RecommendResponse>( + service, METHODID_RECOMMEND))) + .build(); + } + + private abstract static class RecommendationServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + RecommendationServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.RecommendationServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("RecommendationService"); + } + } + + private static final class RecommendationServiceFileDescriptorSupplier + extends RecommendationServiceBaseDescriptorSupplier { + RecommendationServiceFileDescriptorSupplier() {} + } + + private static final class RecommendationServiceMethodDescriptorSupplier + extends RecommendationServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + RecommendationServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (RecommendationServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new RecommendationServiceFileDescriptorSupplier()) + .addMethod(getRecommendMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceGrpc.java b/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceGrpc.java new file mode 100644 index 000000000000..f25ab18538e6 --- /dev/null +++ b/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceGrpc.java @@ -0,0 +1,839 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.discoveryengine.v1alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for managing [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/discoveryengine/v1alpha/schema_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class SchemaServiceGrpc { + + private SchemaServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.discoveryengine.v1alpha.SchemaService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest, + com.google.cloud.discoveryengine.v1alpha.Schema> + getGetSchemaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSchema", + requestType = com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest.class, + responseType = com.google.cloud.discoveryengine.v1alpha.Schema.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest, + com.google.cloud.discoveryengine.v1alpha.Schema> + getGetSchemaMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest, + com.google.cloud.discoveryengine.v1alpha.Schema> + getGetSchemaMethod; + if ((getGetSchemaMethod = SchemaServiceGrpc.getGetSchemaMethod) == null) { + synchronized (SchemaServiceGrpc.class) { + if ((getGetSchemaMethod = SchemaServiceGrpc.getGetSchemaMethod) == null) { + SchemaServiceGrpc.getGetSchemaMethod = + getGetSchemaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSchema")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.Schema.getDefaultInstance())) + .setSchemaDescriptor(new SchemaServiceMethodDescriptorSupplier("GetSchema")) + .build(); + } + } + } + return getGetSchemaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest, + com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse> + getListSchemasMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSchemas", + requestType = com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest.class, + responseType = com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest, + com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse> + getListSchemasMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest, + com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse> + getListSchemasMethod; + if ((getListSchemasMethod = SchemaServiceGrpc.getListSchemasMethod) == null) { + synchronized (SchemaServiceGrpc.class) { + if ((getListSchemasMethod = SchemaServiceGrpc.getListSchemasMethod) == null) { + SchemaServiceGrpc.getListSchemasMethod = + getListSchemasMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSchemas")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse + .getDefaultInstance())) + .setSchemaDescriptor(new SchemaServiceMethodDescriptorSupplier("ListSchemas")) + .build(); + } + } + } + return getListSchemasMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest, + com.google.longrunning.Operation> + getCreateSchemaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSchema", + requestType = com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest, + com.google.longrunning.Operation> + getCreateSchemaMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest, + com.google.longrunning.Operation> + getCreateSchemaMethod; + if ((getCreateSchemaMethod = SchemaServiceGrpc.getCreateSchemaMethod) == null) { + synchronized (SchemaServiceGrpc.class) { + if ((getCreateSchemaMethod = SchemaServiceGrpc.getCreateSchemaMethod) == null) { + SchemaServiceGrpc.getCreateSchemaMethod = + getCreateSchemaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSchema")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SchemaServiceMethodDescriptorSupplier("CreateSchema")) + .build(); + } + } + } + return getCreateSchemaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest, + com.google.longrunning.Operation> + getUpdateSchemaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateSchema", + requestType = com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest, + com.google.longrunning.Operation> + getUpdateSchemaMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest, + com.google.longrunning.Operation> + getUpdateSchemaMethod; + if ((getUpdateSchemaMethod = SchemaServiceGrpc.getUpdateSchemaMethod) == null) { + synchronized (SchemaServiceGrpc.class) { + if ((getUpdateSchemaMethod = SchemaServiceGrpc.getUpdateSchemaMethod) == null) { + SchemaServiceGrpc.getUpdateSchemaMethod = + getUpdateSchemaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateSchema")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SchemaServiceMethodDescriptorSupplier("UpdateSchema")) + .build(); + } + } + } + return getUpdateSchemaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest, + com.google.longrunning.Operation> + getDeleteSchemaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteSchema", + requestType = com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest, + com.google.longrunning.Operation> + getDeleteSchemaMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest, + com.google.longrunning.Operation> + getDeleteSchemaMethod; + if ((getDeleteSchemaMethod = SchemaServiceGrpc.getDeleteSchemaMethod) == null) { + synchronized (SchemaServiceGrpc.class) { + if ((getDeleteSchemaMethod = SchemaServiceGrpc.getDeleteSchemaMethod) == null) { + SchemaServiceGrpc.getDeleteSchemaMethod = + getDeleteSchemaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSchema")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SchemaServiceMethodDescriptorSupplier("DeleteSchema")) + .build(); + } + } + } + return getDeleteSchemaMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SchemaServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SchemaServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SchemaServiceStub(channel, callOptions); + } + }; + return SchemaServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SchemaServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SchemaServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SchemaServiceBlockingStub(channel, callOptions); + } + }; + return SchemaServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SchemaServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SchemaServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SchemaServiceFutureStub(channel, callOptions); + } + }; + return SchemaServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for managing [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Gets a [Schema][google.cloud.discoveryengine.v1alpha.Schema].
+     * 
+ */ + default void getSchema( + com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSchemaMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a list of [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+     * 
+ */ + default void listSchemas( + com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListSchemasMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a [Schema][google.cloud.discoveryengine.v1alpha.Schema].
+     * 
+ */ + default void createSchema( + com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSchemaMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a [Schema][google.cloud.discoveryengine.v1alpha.Schema].
+     * 
+ */ + default void updateSchema( + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateSchemaMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a [Schema][google.cloud.discoveryengine.v1alpha.Schema].
+     * 
+ */ + default void deleteSchema( + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteSchemaMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service SchemaService. + * + *
+   * Service for managing [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+   * 
+ */ + public abstract static class SchemaServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SchemaServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SchemaService. + * + *
+   * Service for managing [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+   * 
+ */ + public static final class SchemaServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SchemaServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SchemaServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SchemaServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets a [Schema][google.cloud.discoveryengine.v1alpha.Schema].
+     * 
+ */ + public void getSchema( + com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSchemaMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Gets a list of [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+     * 
+ */ + public void listSchemas( + com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSchemasMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a [Schema][google.cloud.discoveryengine.v1alpha.Schema].
+     * 
+ */ + public void createSchema( + com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSchemaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a [Schema][google.cloud.discoveryengine.v1alpha.Schema].
+     * 
+ */ + public void updateSchema( + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateSchemaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a [Schema][google.cloud.discoveryengine.v1alpha.Schema].
+     * 
+ */ + public void deleteSchema( + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteSchemaMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SchemaService. + * + *
+   * Service for managing [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+   * 
+ */ + public static final class SchemaServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SchemaServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SchemaServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SchemaServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets a [Schema][google.cloud.discoveryengine.v1alpha.Schema].
+     * 
+ */ + public com.google.cloud.discoveryengine.v1alpha.Schema getSchema( + com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSchemaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a list of [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+     * 
+ */ + public com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse listSchemas( + com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSchemasMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a [Schema][google.cloud.discoveryengine.v1alpha.Schema].
+     * 
+ */ + public com.google.longrunning.Operation createSchema( + com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSchemaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a [Schema][google.cloud.discoveryengine.v1alpha.Schema].
+     * 
+ */ + public com.google.longrunning.Operation updateSchema( + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateSchemaMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a [Schema][google.cloud.discoveryengine.v1alpha.Schema].
+     * 
+ */ + public com.google.longrunning.Operation deleteSchema( + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteSchemaMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SchemaService. + * + *
+   * Service for managing [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+   * 
+ */ + public static final class SchemaServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SchemaServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SchemaServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SchemaServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets a [Schema][google.cloud.discoveryengine.v1alpha.Schema].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.discoveryengine.v1alpha.Schema> + getSchema(com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSchemaMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a list of [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse> + listSchemas(com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSchemasMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a [Schema][google.cloud.discoveryengine.v1alpha.Schema].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createSchema(com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSchemaMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a [Schema][google.cloud.discoveryengine.v1alpha.Schema].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateSchema(com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateSchemaMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a [Schema][google.cloud.discoveryengine.v1alpha.Schema].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteSchema(com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteSchemaMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_SCHEMA = 0; + private static final int METHODID_LIST_SCHEMAS = 1; + private static final int METHODID_CREATE_SCHEMA = 2; + private static final int METHODID_UPDATE_SCHEMA = 3; + private static final int METHODID_DELETE_SCHEMA = 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 AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GET_SCHEMA: + serviceImpl.getSchema( + (com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_SCHEMAS: + serviceImpl.listSchemas( + (com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse>) + responseObserver); + break; + case METHODID_CREATE_SCHEMA: + serviceImpl.createSchema( + (com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_SCHEMA: + serviceImpl.updateSchema( + (com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_SCHEMA: + serviceImpl.deleteSchema( + (com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetSchemaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest, + com.google.cloud.discoveryengine.v1alpha.Schema>(service, METHODID_GET_SCHEMA))) + .addMethod( + getListSchemasMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest, + com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse>( + service, METHODID_LIST_SCHEMAS))) + .addMethod( + getCreateSchemaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest, + com.google.longrunning.Operation>(service, METHODID_CREATE_SCHEMA))) + .addMethod( + getUpdateSchemaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest, + com.google.longrunning.Operation>(service, METHODID_UPDATE_SCHEMA))) + .addMethod( + getDeleteSchemaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest, + com.google.longrunning.Operation>(service, METHODID_DELETE_SCHEMA))) + .build(); + } + + private abstract static class SchemaServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SchemaServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SchemaService"); + } + } + + private static final class SchemaServiceFileDescriptorSupplier + extends SchemaServiceBaseDescriptorSupplier { + SchemaServiceFileDescriptorSupplier() {} + } + + private static final class SchemaServiceMethodDescriptorSupplier + extends SchemaServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SchemaServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SchemaServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SchemaServiceFileDescriptorSupplier()) + .addMethod(getGetSchemaMethod()) + .addMethod(getListSchemasMethod()) + .addMethod(getCreateSchemaMethod()) + .addMethod(getUpdateSchemaMethod()) + .addMethod(getDeleteSchemaMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceGrpc.java b/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceGrpc.java new file mode 100644 index 000000000000..a3e3a5d13cb2 --- /dev/null +++ b/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceGrpc.java @@ -0,0 +1,375 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.discoveryengine.v1alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for search.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/discoveryengine/v1alpha/search_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class SearchServiceGrpc { + + private SearchServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.discoveryengine.v1alpha.SearchService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.SearchRequest, + com.google.cloud.discoveryengine.v1alpha.SearchResponse> + getSearchMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Search", + requestType = com.google.cloud.discoveryengine.v1alpha.SearchRequest.class, + responseType = com.google.cloud.discoveryengine.v1alpha.SearchResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.SearchRequest, + com.google.cloud.discoveryengine.v1alpha.SearchResponse> + getSearchMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.SearchRequest, + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.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.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Performs a search.
+     * 
+ */ + default void search( + com.google.cloud.discoveryengine.v1alpha.SearchRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSearchMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service SearchService. + * + *
+   * Service for search.
+   * 
+ */ + public abstract static class SearchServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SearchServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SearchService. + * + *
+   * Service for search.
+   * 
+ */ + 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.
+     * 
+ */ + public void search( + com.google.cloud.discoveryengine.v1alpha.SearchRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSearchMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SearchService. + * + *
+   * Service for search.
+   * 
+ */ + 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.
+     * 
+ */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse search( + com.google.cloud.discoveryengine.v1alpha.SearchRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SearchService. + * + *
+   * Service for search.
+   * 
+ */ + 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.discoveryengine.v1alpha.SearchResponse> + search(com.google.cloud.discoveryengine.v1alpha.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 AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_SEARCH: + serviceImpl.search( + (com.google.cloud.discoveryengine.v1alpha.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(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getSearchMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.SearchRequest, + com.google.cloud.discoveryengine.v1alpha.SearchResponse>( + service, METHODID_SEARCH))) + .build(); + } + + 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.discoveryengine.v1alpha.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 java.lang.String methodName; + + SearchServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (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/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceGrpc.java b/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceGrpc.java new file mode 100644 index 000000000000..6467d5cb624c --- /dev/null +++ b/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceGrpc.java @@ -0,0 +1,377 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.discoveryengine.v1alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for managing site search related resources.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/discoveryengine/v1alpha/site_search_engine_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class SiteSearchEngineServiceGrpc { + + private SiteSearchEngineServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.discoveryengine.v1alpha.SiteSearchEngineService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest, + com.google.longrunning.Operation> + getRecrawlUrisMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RecrawlUris", + requestType = com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest, + com.google.longrunning.Operation> + getRecrawlUrisMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest, + com.google.longrunning.Operation> + getRecrawlUrisMethod; + if ((getRecrawlUrisMethod = SiteSearchEngineServiceGrpc.getRecrawlUrisMethod) == null) { + synchronized (SiteSearchEngineServiceGrpc.class) { + if ((getRecrawlUrisMethod = SiteSearchEngineServiceGrpc.getRecrawlUrisMethod) == null) { + SiteSearchEngineServiceGrpc.getRecrawlUrisMethod = + getRecrawlUrisMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RecrawlUris")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SiteSearchEngineServiceMethodDescriptorSupplier("RecrawlUris")) + .build(); + } + } + } + return getRecrawlUrisMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SiteSearchEngineServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SiteSearchEngineServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SiteSearchEngineServiceStub(channel, callOptions); + } + }; + return SiteSearchEngineServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SiteSearchEngineServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SiteSearchEngineServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SiteSearchEngineServiceBlockingStub(channel, callOptions); + } + }; + return SiteSearchEngineServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SiteSearchEngineServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SiteSearchEngineServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SiteSearchEngineServiceFutureStub(channel, callOptions); + } + }; + return SiteSearchEngineServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for managing site search related resources.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Request on-demand recrawl for a list of URIs.
+     * 
+ */ + default void recrawlUris( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRecrawlUrisMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service SiteSearchEngineService. + * + *
+   * Service for managing site search related resources.
+   * 
+ */ + public abstract static class SiteSearchEngineServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SiteSearchEngineServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SiteSearchEngineService. + * + *
+   * Service for managing site search related resources.
+   * 
+ */ + public static final class SiteSearchEngineServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SiteSearchEngineServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SiteSearchEngineServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SiteSearchEngineServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Request on-demand recrawl for a list of URIs.
+     * 
+ */ + public void recrawlUris( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRecrawlUrisMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SiteSearchEngineService. + * + *
+   * Service for managing site search related resources.
+   * 
+ */ + public static final class SiteSearchEngineServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SiteSearchEngineServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SiteSearchEngineServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SiteSearchEngineServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Request on-demand recrawl for a list of URIs.
+     * 
+ */ + public com.google.longrunning.Operation recrawlUris( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRecrawlUrisMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * SiteSearchEngineService. + * + *
+   * Service for managing site search related resources.
+   * 
+ */ + public static final class SiteSearchEngineServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SiteSearchEngineServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SiteSearchEngineServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SiteSearchEngineServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Request on-demand recrawl for a list of URIs.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + recrawlUris(com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRecrawlUrisMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_RECRAWL_URIS = 0; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_RECRAWL_URIS: + serviceImpl.recrawlUris( + (com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getRecrawlUrisMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest, + com.google.longrunning.Operation>(service, METHODID_RECRAWL_URIS))) + .build(); + } + + private abstract static class SiteSearchEngineServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SiteSearchEngineServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SiteSearchEngineService"); + } + } + + private static final class SiteSearchEngineServiceFileDescriptorSupplier + extends SiteSearchEngineServiceBaseDescriptorSupplier { + SiteSearchEngineServiceFileDescriptorSupplier() {} + } + + private static final class SiteSearchEngineServiceMethodDescriptorSupplier + extends SiteSearchEngineServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SiteSearchEngineServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SiteSearchEngineServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SiteSearchEngineServiceFileDescriptorSupplier()) + .addMethod(getRecrawlUrisMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceGrpc.java b/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceGrpc.java new file mode 100644 index 000000000000..3db044fe9bec --- /dev/null +++ b/java-discoveryengine/grpc-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceGrpc.java @@ -0,0 +1,766 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.discoveryengine.v1alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for ingesting end user actions on a website to Discovery Engine API.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/discoveryengine/v1alpha/user_event_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class UserEventServiceGrpc { + + private UserEventServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.discoveryengine.v1alpha.UserEventService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest, + com.google.cloud.discoveryengine.v1alpha.UserEvent> + getWriteUserEventMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "WriteUserEvent", + requestType = com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest.class, + responseType = com.google.cloud.discoveryengine.v1alpha.UserEvent.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest, + com.google.cloud.discoveryengine.v1alpha.UserEvent> + getWriteUserEventMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest, + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.WriteUserEventRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.discoveryengine.v1alpha.UserEvent + .getDefaultInstance())) + .setSchemaDescriptor( + new UserEventServiceMethodDescriptorSupplier("WriteUserEvent")) + .build(); + } + } + } + return getWriteUserEventMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest, com.google.api.HttpBody> + getCollectUserEventMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CollectUserEvent", + requestType = com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest.class, + responseType = com.google.api.HttpBody.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest, com.google.api.HttpBody> + getCollectUserEventMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.PurgeUserEventsRequest, + com.google.longrunning.Operation> + getPurgeUserEventsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PurgeUserEvents", + requestType = com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest, + com.google.longrunning.Operation> + getPurgeUserEventsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.ImportUserEventsRequest, + com.google.longrunning.Operation> + getImportUserEventsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ImportUserEvents", + requestType = com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest, + com.google.longrunning.Operation> + getImportUserEventsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.ImportUserEventsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new UserEventServiceMethodDescriptorSupplier("ImportUserEvents")) + .build(); + } + } + } + return getImportUserEventsMethod; + } + + /** 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 a website to Discovery Engine API.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Writes a single user event.
+     * 
+ */ + default void writeUserEvent( + com.google.cloud.discoveryengine.v1alpha.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 third-party domain.
+     * This method is used only by the Discovery Engine API JavaScript pixel and
+     * Google Tag Manager. Users should not call this method directly.
+     * 
+ */ + default void collectUserEvent( + com.google.cloud.discoveryengine.v1alpha.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.
+     * 
+ */ + default void purgeUserEvents( + com.google.cloud.discoveryengine.v1alpha.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.
+     * 
+ */ + default void importUserEvents( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getImportUserEventsMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service UserEventService. + * + *
+   * Service for ingesting end user actions on a website to Discovery Engine API.
+   * 
+ */ + public abstract static class UserEventServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return UserEventServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service UserEventService. + * + *
+   * Service for ingesting end user actions on a website to Discovery Engine API.
+   * 
+ */ + 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.discoveryengine.v1alpha.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 third-party domain.
+     * This method is used only by the Discovery Engine API JavaScript pixel and
+     * Google Tag Manager. Users should not call this method directly.
+     * 
+ */ + public void collectUserEvent( + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.ImportUserEventsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getImportUserEventsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service UserEventService. + * + *
+   * Service for ingesting end user actions on a website to Discovery Engine API.
+   * 
+ */ + 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.discoveryengine.v1alpha.UserEvent writeUserEvent( + com.google.cloud.discoveryengine.v1alpha.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 third-party domain.
+     * This method is used only by the Discovery Engine API JavaScript pixel and
+     * Google Tag Manager. Users should not call this method directly.
+     * 
+ */ + public com.google.api.HttpBody collectUserEvent( + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.ImportUserEventsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getImportUserEventsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service UserEventService. + * + *
+   * Service for ingesting end user actions on a website to Discovery Engine API.
+   * 
+ */ + 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.discoveryengine.v1alpha.UserEvent> + writeUserEvent(com.google.cloud.discoveryengine.v1alpha.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 third-party domain.
+     * This method is used only by the Discovery Engine 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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.ImportUserEventsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getImportUserEventsMethod(), 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 class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_WRITE_USER_EVENT: + serviceImpl.writeUserEvent( + (com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_COLLECT_USER_EVENT: + serviceImpl.collectUserEvent( + (com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_PURGE_USER_EVENTS: + serviceImpl.purgeUserEvents( + (com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_IMPORT_USER_EVENTS: + serviceImpl.importUserEvents( + (com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getWriteUserEventMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest, + com.google.cloud.discoveryengine.v1alpha.UserEvent>( + service, METHODID_WRITE_USER_EVENT))) + .addMethod( + getCollectUserEventMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest, + com.google.api.HttpBody>(service, METHODID_COLLECT_USER_EVENT))) + .addMethod( + getPurgeUserEventsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest, + com.google.longrunning.Operation>(service, METHODID_PURGE_USER_EVENTS))) + .addMethod( + getImportUserEventsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest, + com.google.longrunning.Operation>(service, METHODID_IMPORT_USER_EVENTS))) + .build(); + } + + 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.discoveryengine.v1alpha.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 java.lang.String methodName; + + UserEventServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (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()) + .build(); + } + } + } + return result; + } +} diff --git a/java-discoveryengine/pom.xml b/java-discoveryengine/pom.xml index 710a15d83d49..0f24b173cc19 100644 --- a/java-discoveryengine/pom.xml +++ b/java-discoveryengine/pom.xml @@ -31,6 +31,16 @@ google-cloud-discoveryengine 0.24.0 + + com.google.api.grpc + proto-google-cloud-discoveryengine-v1alpha + 0.24.0 + + + com.google.api.grpc + grpc-google-cloud-discoveryengine-v1alpha + 0.24.0 + com.google.api.grpc proto-google-cloud-discoveryengine-v1 @@ -58,8 +68,10 @@ google-cloud-discoveryengine grpc-google-cloud-discoveryengine-v1beta grpc-google-cloud-discoveryengine-v1 + grpc-google-cloud-discoveryengine-v1alpha proto-google-cloud-discoveryengine-v1beta proto-google-cloud-discoveryengine-v1 + proto-google-cloud-discoveryengine-v1alpha google-cloud-discoveryengine-bom diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/clirr-ignored-differences.xml b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/clirr-ignored-differences.xml new file mode 100644 index 000000000000..69e4c6594cee --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/discoveryengine/v1alpha/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/discoveryengine/v1alpha/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/discoveryengine/v1alpha/*OrBuilder + boolean has*(*) + + diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/pom.xml b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/pom.xml new file mode 100644 index 000000000000..9d8fb6e23057 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-discoveryengine-v1alpha + 0.24.0 + proto-google-cloud-discoveryengine-v1alpha + Proto library for google-cloud-discoveryengine + + com.google.cloud + google-cloud-discoveryengine-parent + 0.24.0 + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/BigQuerySource.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/BigQuerySource.java new file mode 100644 index 000000000000..131f6058646e --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/BigQuerySource.java @@ -0,0 +1,1893 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/import_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * BigQuery source import data from.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.BigQuerySource} + */ +public final class BigQuerySource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_BigQuerySource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_BigQuerySource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.BigQuerySource.class, + com.google.cloud.discoveryengine.v1alpha.BigQuerySource.Builder.class); + } + + private int partitionCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object partition_; + + public enum PartitionCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PARTITION_DATE(5), + 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 5: + 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 = 5; + /** + * + * + *
+   * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+   * 
+ * + * .google.type.Date partition_date = 5; + * + * @return Whether the partitionDate field is set. + */ + @java.lang.Override + public boolean hasPartitionDate() { + return partitionCase_ == 5; + } + /** + * + * + *
+   * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+   * 
+ * + * .google.type.Date partition_date = 5; + * + * @return The partitionDate. + */ + @java.lang.Override + public com.google.type.Date getPartitionDate() { + if (partitionCase_ == 5) { + return (com.google.type.Date) partition_; + } + return com.google.type.Date.getDefaultInstance(); + } + /** + * + * + *
+   * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+   * 
+ * + * .google.type.Date partition_date = 5; + */ + @java.lang.Override + public com.google.type.DateOrBuilder getPartitionDateOrBuilder() { + if (partitionCase_ == 5) { + return (com.google.type.Date) partition_; + } + return com.google.type.Date.getDefaultInstance(); + } + + public static final int PROJECT_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + 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 = 1; + * + * @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 = 1; + * + * @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 = 2; + + @SuppressWarnings("serial") + 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 = 2 [(.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 = 2 [(.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 = 3; + + @SuppressWarnings("serial") + 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 = 3 [(.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 = 3 [(.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 = 4; + + @SuppressWarnings("serial") + 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 = 4; + * + * @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 = 4; + * + * @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 = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object dataSchema_ = ""; + /** + * + * + *
+   * The schema to use when parsing the data from the source.
+   *
+   * Supported values for user event imports:
+   *
+   * * `user_event` (default): One
+   * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] per row.
+   *
+   * Supported values for document imports:
+   *
+   * * `document` (default): One
+   * [Document][google.cloud.discoveryengine.v1alpha.Document] format per
+   *   row. Each document must have a valid
+   *   [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] and one
+   *   of
+   *   [Document.json_data][google.cloud.discoveryengine.v1alpha.Document.json_data]
+   *   or
+   *   [Document.struct_data][google.cloud.discoveryengine.v1alpha.Document.struct_data].
+   * * `custom`: One custom data per row in arbitrary format that conforms to
+   *   the defined [Schema][google.cloud.discoveryengine.v1alpha.Schema] of the
+   *   data store. This can only be used by Gen App Builder.
+   * 
+ * + * string data_schema = 6; + * + * @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 user event imports:
+   *
+   * * `user_event` (default): One
+   * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] per row.
+   *
+   * Supported values for document imports:
+   *
+   * * `document` (default): One
+   * [Document][google.cloud.discoveryengine.v1alpha.Document] format per
+   *   row. Each document must have a valid
+   *   [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] and one
+   *   of
+   *   [Document.json_data][google.cloud.discoveryengine.v1alpha.Document.json_data]
+   *   or
+   *   [Document.struct_data][google.cloud.discoveryengine.v1alpha.Document.struct_data].
+   * * `custom`: One custom data per row in arbitrary format that conforms to
+   *   the defined [Schema][google.cloud.discoveryengine.v1alpha.Schema] of the
+   *   data store. This can only be used by Gen App Builder.
+   * 
+ * + * string data_schema = 6; + * + * @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(projectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(datasetId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, datasetId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tableId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, tableId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gcsStagingDir_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, gcsStagingDir_); + } + if (partitionCase_ == 5) { + output.writeMessage(5, (com.google.type.Date) partition_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataSchema_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, dataSchema_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(datasetId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, datasetId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tableId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, tableId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(gcsStagingDir_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, gcsStagingDir_); + } + if (partitionCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.type.Date) partition_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataSchema_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, dataSchema_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.BigQuerySource)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.BigQuerySource other = + (com.google.cloud.discoveryengine.v1alpha.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 5: + if (!getPartitionDate().equals(other.getPartitionDate())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + 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 5: + hash = (37 * hash) + PARTITION_DATE_FIELD_NUMBER; + hash = (53 * hash) + getPartitionDate().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.BigQuerySource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.BigQuerySource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.BigQuerySource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.BigQuerySource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.BigQuerySource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.BigQuerySource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.BigQuerySource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.BigQuerySource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.BigQuerySource) + com.google.cloud.discoveryengine.v1alpha.BigQuerySourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_BigQuerySource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_BigQuerySource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.BigQuerySource.class, + com.google.cloud.discoveryengine.v1alpha.BigQuerySource.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.BigQuerySource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (partitionDateBuilder_ != null) { + partitionDateBuilder_.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.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_BigQuerySource_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.BigQuerySource getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.BigQuerySource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.BigQuerySource build() { + com.google.cloud.discoveryengine.v1alpha.BigQuerySource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.BigQuerySource buildPartial() { + com.google.cloud.discoveryengine.v1alpha.BigQuerySource result = + new com.google.cloud.discoveryengine.v1alpha.BigQuerySource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.BigQuerySource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.projectId_ = projectId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.datasetId_ = datasetId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.tableId_ = tableId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.gcsStagingDir_ = gcsStagingDir_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.dataSchema_ = dataSchema_; + } + } + + private void buildPartialOneofs( + com.google.cloud.discoveryengine.v1alpha.BigQuerySource result) { + result.partitionCase_ = partitionCase_; + result.partition_ = this.partition_; + if (partitionCase_ == 5 && partitionDateBuilder_ != null) { + result.partition_ = partitionDateBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.BigQuerySource) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.BigQuerySource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.BigQuerySource other) { + if (other == com.google.cloud.discoveryengine.v1alpha.BigQuerySource.getDefaultInstance()) + return this; + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDatasetId().isEmpty()) { + datasetId_ = other.datasetId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getTableId().isEmpty()) { + tableId_ = other.tableId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getGcsStagingDir().isEmpty()) { + gcsStagingDir_ = other.gcsStagingDir_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getDataSchema().isEmpty()) { + dataSchema_ = other.dataSchema_; + bitField0_ |= 0x00000020; + onChanged(); + } + switch (other.getPartitionCase()) { + case PARTITION_DATE: + { + mergePartitionDate(other.getPartitionDate()); + break; + } + case PARTITION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + projectId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 10 + case 18: + { + datasetId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 18 + case 26: + { + tableId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + gcsStagingDir_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 42: + { + input.readMessage(getPartitionDateFieldBuilder().getBuilder(), extensionRegistry); + partitionCase_ = 5; + break; + } // case 42 + case 50: + { + dataSchema_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int 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 int bitField0_; + + 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.
+     * 
+ * + * .google.type.Date partition_date = 5; + * + * @return Whether the partitionDate field is set. + */ + @java.lang.Override + public boolean hasPartitionDate() { + return partitionCase_ == 5; + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * 
+ * + * .google.type.Date partition_date = 5; + * + * @return The partitionDate. + */ + @java.lang.Override + public com.google.type.Date getPartitionDate() { + if (partitionDateBuilder_ == null) { + if (partitionCase_ == 5) { + return (com.google.type.Date) partition_; + } + return com.google.type.Date.getDefaultInstance(); + } else { + if (partitionCase_ == 5) { + return partitionDateBuilder_.getMessage(); + } + return com.google.type.Date.getDefaultInstance(); + } + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * 
+ * + * .google.type.Date partition_date = 5; + */ + 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_ = 5; + return this; + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * 
+ * + * .google.type.Date partition_date = 5; + */ + public Builder setPartitionDate(com.google.type.Date.Builder builderForValue) { + if (partitionDateBuilder_ == null) { + partition_ = builderForValue.build(); + onChanged(); + } else { + partitionDateBuilder_.setMessage(builderForValue.build()); + } + partitionCase_ = 5; + return this; + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * 
+ * + * .google.type.Date partition_date = 5; + */ + public Builder mergePartitionDate(com.google.type.Date value) { + if (partitionDateBuilder_ == null) { + if (partitionCase_ == 5 && 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_ == 5) { + partitionDateBuilder_.mergeFrom(value); + } else { + partitionDateBuilder_.setMessage(value); + } + } + partitionCase_ = 5; + return this; + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * 
+ * + * .google.type.Date partition_date = 5; + */ + public Builder clearPartitionDate() { + if (partitionDateBuilder_ == null) { + if (partitionCase_ == 5) { + partitionCase_ = 0; + partition_ = null; + onChanged(); + } + } else { + if (partitionCase_ == 5) { + partitionCase_ = 0; + partition_ = null; + } + partitionDateBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * 
+ * + * .google.type.Date partition_date = 5; + */ + public com.google.type.Date.Builder getPartitionDateBuilder() { + return getPartitionDateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * 
+ * + * .google.type.Date partition_date = 5; + */ + @java.lang.Override + public com.google.type.DateOrBuilder getPartitionDateOrBuilder() { + if ((partitionCase_ == 5) && (partitionDateBuilder_ != null)) { + return partitionDateBuilder_.getMessageOrBuilder(); + } else { + if (partitionCase_ == 5) { + return (com.google.type.Date) partition_; + } + return com.google.type.Date.getDefaultInstance(); + } + } + /** + * + * + *
+     * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+     * 
+ * + * .google.type.Date partition_date = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> + getPartitionDateFieldBuilder() { + if (partitionDateBuilder_ == null) { + if (!(partitionCase_ == 5)) { + 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_ = 5; + 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 = 1; + * + * @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 = 1; + * + * @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 = 1; + * + * @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; + bitField0_ |= 0x00000002; + 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 = 1; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + projectId_ = getDefaultInstance().getProjectId(); + bitField0_ = (bitField0_ & ~0x00000002); + 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 = 1; + * + * @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; + bitField0_ |= 0x00000002; + 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 = 2 [(.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 = 2 [(.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 = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The datasetId to set. + * @return This builder for chaining. + */ + public Builder setDatasetId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + datasetId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The BigQuery data set to copy the data from with a length limit
+     * of 1,024 characters.
+     * 
+ * + * string dataset_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDatasetId() { + datasetId_ = getDefaultInstance().getDatasetId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The BigQuery data set to copy the data from with a length limit
+     * of 1,024 characters.
+     * 
+ * + * string dataset_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for datasetId to set. + * @return This builder for chaining. + */ + public Builder setDatasetIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + datasetId_ = value; + bitField0_ |= 0x00000004; + 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 = 3 [(.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 = 3 [(.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 = 3 [(.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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The BigQuery table to copy the data from with a length limit of
+     * 1,024 characters.
+     * 
+ * + * string table_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTableId() { + tableId_ = getDefaultInstance().getTableId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The BigQuery table to copy the data from with a length limit of
+     * 1,024 characters.
+     * 
+ * + * string table_id = 3 [(.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; + bitField0_ |= 0x00000008; + 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 = 4; + * + * @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 = 4; + * + * @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 = 4; + * + * @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; + bitField0_ |= 0x00000010; + 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 = 4; + * + * @return This builder for chaining. + */ + public Builder clearGcsStagingDir() { + gcsStagingDir_ = getDefaultInstance().getGcsStagingDir(); + bitField0_ = (bitField0_ & ~0x00000010); + 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 = 4; + * + * @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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object dataSchema_ = ""; + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     *
+     * Supported values for user event imports:
+     *
+     * * `user_event` (default): One
+     * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] per row.
+     *
+     * Supported values for document imports:
+     *
+     * * `document` (default): One
+     * [Document][google.cloud.discoveryengine.v1alpha.Document] format per
+     *   row. Each document must have a valid
+     *   [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] and one
+     *   of
+     *   [Document.json_data][google.cloud.discoveryengine.v1alpha.Document.json_data]
+     *   or
+     *   [Document.struct_data][google.cloud.discoveryengine.v1alpha.Document.struct_data].
+     * * `custom`: One custom data per row in arbitrary format that conforms to
+     *   the defined [Schema][google.cloud.discoveryengine.v1alpha.Schema] of the
+     *   data store. This can only be used by Gen App Builder.
+     * 
+ * + * string data_schema = 6; + * + * @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 user event imports:
+     *
+     * * `user_event` (default): One
+     * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] per row.
+     *
+     * Supported values for document imports:
+     *
+     * * `document` (default): One
+     * [Document][google.cloud.discoveryengine.v1alpha.Document] format per
+     *   row. Each document must have a valid
+     *   [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] and one
+     *   of
+     *   [Document.json_data][google.cloud.discoveryengine.v1alpha.Document.json_data]
+     *   or
+     *   [Document.struct_data][google.cloud.discoveryengine.v1alpha.Document.struct_data].
+     * * `custom`: One custom data per row in arbitrary format that conforms to
+     *   the defined [Schema][google.cloud.discoveryengine.v1alpha.Schema] of the
+     *   data store. This can only be used by Gen App Builder.
+     * 
+ * + * string data_schema = 6; + * + * @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 user event imports:
+     *
+     * * `user_event` (default): One
+     * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] per row.
+     *
+     * Supported values for document imports:
+     *
+     * * `document` (default): One
+     * [Document][google.cloud.discoveryengine.v1alpha.Document] format per
+     *   row. Each document must have a valid
+     *   [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] and one
+     *   of
+     *   [Document.json_data][google.cloud.discoveryengine.v1alpha.Document.json_data]
+     *   or
+     *   [Document.struct_data][google.cloud.discoveryengine.v1alpha.Document.struct_data].
+     * * `custom`: One custom data per row in arbitrary format that conforms to
+     *   the defined [Schema][google.cloud.discoveryengine.v1alpha.Schema] of the
+     *   data store. This can only be used by Gen App Builder.
+     * 
+ * + * string data_schema = 6; + * + * @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; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     *
+     * Supported values for user event imports:
+     *
+     * * `user_event` (default): One
+     * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] per row.
+     *
+     * Supported values for document imports:
+     *
+     * * `document` (default): One
+     * [Document][google.cloud.discoveryengine.v1alpha.Document] format per
+     *   row. Each document must have a valid
+     *   [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] and one
+     *   of
+     *   [Document.json_data][google.cloud.discoveryengine.v1alpha.Document.json_data]
+     *   or
+     *   [Document.struct_data][google.cloud.discoveryengine.v1alpha.Document.struct_data].
+     * * `custom`: One custom data per row in arbitrary format that conforms to
+     *   the defined [Schema][google.cloud.discoveryengine.v1alpha.Schema] of the
+     *   data store. This can only be used by Gen App Builder.
+     * 
+ * + * string data_schema = 6; + * + * @return This builder for chaining. + */ + public Builder clearDataSchema() { + dataSchema_ = getDefaultInstance().getDataSchema(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     *
+     * Supported values for user event imports:
+     *
+     * * `user_event` (default): One
+     * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] per row.
+     *
+     * Supported values for document imports:
+     *
+     * * `document` (default): One
+     * [Document][google.cloud.discoveryengine.v1alpha.Document] format per
+     *   row. Each document must have a valid
+     *   [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] and one
+     *   of
+     *   [Document.json_data][google.cloud.discoveryengine.v1alpha.Document.json_data]
+     *   or
+     *   [Document.struct_data][google.cloud.discoveryengine.v1alpha.Document.struct_data].
+     * * `custom`: One custom data per row in arbitrary format that conforms to
+     *   the defined [Schema][google.cloud.discoveryengine.v1alpha.Schema] of the
+     *   data store. This can only be used by Gen App Builder.
+     * 
+ * + * string data_schema = 6; + * + * @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; + bitField0_ |= 0x00000020; + 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.discoveryengine.v1alpha.BigQuerySource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.BigQuerySource) + private static final com.google.cloud.discoveryengine.v1alpha.BigQuerySource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.BigQuerySource(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.BigQuerySource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/BigQuerySourceOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/BigQuerySourceOrBuilder.java new file mode 100644 index 000000000000..3131a1b4fd9b --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/BigQuerySourceOrBuilder.java @@ -0,0 +1,237 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/import_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface BigQuerySourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.BigQuerySource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+   * 
+ * + * .google.type.Date partition_date = 5; + * + * @return Whether the partitionDate field is set. + */ + boolean hasPartitionDate(); + /** + * + * + *
+   * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+   * 
+ * + * .google.type.Date partition_date = 5; + * + * @return The partitionDate. + */ + com.google.type.Date getPartitionDate(); + /** + * + * + *
+   * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
+   * 
+ * + * .google.type.Date partition_date = 5; + */ + 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 = 1; + * + * @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 = 1; + * + * @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 = 2 [(.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 = 2 [(.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 = 3 [(.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 = 3 [(.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 = 4; + * + * @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 = 4; + * + * @return The bytes for gcsStagingDir. + */ + com.google.protobuf.ByteString getGcsStagingDirBytes(); + + /** + * + * + *
+   * The schema to use when parsing the data from the source.
+   *
+   * Supported values for user event imports:
+   *
+   * * `user_event` (default): One
+   * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] per row.
+   *
+   * Supported values for document imports:
+   *
+   * * `document` (default): One
+   * [Document][google.cloud.discoveryengine.v1alpha.Document] format per
+   *   row. Each document must have a valid
+   *   [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] and one
+   *   of
+   *   [Document.json_data][google.cloud.discoveryengine.v1alpha.Document.json_data]
+   *   or
+   *   [Document.struct_data][google.cloud.discoveryengine.v1alpha.Document.struct_data].
+   * * `custom`: One custom data per row in arbitrary format that conforms to
+   *   the defined [Schema][google.cloud.discoveryengine.v1alpha.Schema] of the
+   *   data store. This can only be used by Gen App Builder.
+   * 
+ * + * string data_schema = 6; + * + * @return The dataSchema. + */ + java.lang.String getDataSchema(); + /** + * + * + *
+   * The schema to use when parsing the data from the source.
+   *
+   * Supported values for user event imports:
+   *
+   * * `user_event` (default): One
+   * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] per row.
+   *
+   * Supported values for document imports:
+   *
+   * * `document` (default): One
+   * [Document][google.cloud.discoveryengine.v1alpha.Document] format per
+   *   row. Each document must have a valid
+   *   [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] and one
+   *   of
+   *   [Document.json_data][google.cloud.discoveryengine.v1alpha.Document.json_data]
+   *   or
+   *   [Document.struct_data][google.cloud.discoveryengine.v1alpha.Document.struct_data].
+   * * `custom`: One custom data per row in arbitrary format that conforms to
+   *   the defined [Schema][google.cloud.discoveryengine.v1alpha.Schema] of the
+   *   data store. This can only be used by Gen App Builder.
+   * 
+ * + * string data_schema = 6; + * + * @return The bytes for dataSchema. + */ + com.google.protobuf.ByteString getDataSchemaBytes(); + + com.google.cloud.discoveryengine.v1alpha.BigQuerySource.PartitionCase getPartitionCase(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/BranchName.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/BranchName.java new file mode 100644 index 000000000000..008ec59de27a --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/BranchName.java @@ -0,0 +1,427 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +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_DATA_STORE_BRANCH = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}"); + private static final PathTemplate PROJECT_LOCATION_COLLECTION_DATA_STORE_BRANCH = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String dataStore; + private final String branch; + private final String collection; + + @Deprecated + protected BranchName() { + project = null; + location = null; + dataStore = null; + branch = null; + collection = null; + } + + private BranchName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + dataStore = Preconditions.checkNotNull(builder.getDataStore()); + branch = Preconditions.checkNotNull(builder.getBranch()); + collection = null; + pathTemplate = PROJECT_LOCATION_DATA_STORE_BRANCH; + } + + private BranchName(ProjectLocationCollectionDataStoreBranchBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + collection = Preconditions.checkNotNull(builder.getCollection()); + dataStore = Preconditions.checkNotNull(builder.getDataStore()); + branch = Preconditions.checkNotNull(builder.getBranch()); + pathTemplate = PROJECT_LOCATION_COLLECTION_DATA_STORE_BRANCH; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataStore() { + return dataStore; + } + + public String getBranch() { + return branch; + } + + public String getCollection() { + return collection; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectLocationDataStoreBranchBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static ProjectLocationCollectionDataStoreBranchBuilder + newProjectLocationCollectionDataStoreBranchBuilder() { + return new ProjectLocationCollectionDataStoreBranchBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static BranchName of(String project, String location, String dataStore, String branch) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setBranch(branch) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static BranchName ofProjectLocationDataStoreBranchName( + String project, String location, String dataStore, String branch) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setBranch(branch) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static BranchName ofProjectLocationCollectionDataStoreBranchName( + String project, String location, String collection, String dataStore, String branch) { + return newProjectLocationCollectionDataStoreBranchBuilder() + .setProject(project) + .setLocation(location) + .setCollection(collection) + .setDataStore(dataStore) + .setBranch(branch) + .build(); + } + + public static String format(String project, String location, String dataStore, String branch) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setBranch(branch) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationDataStoreBranchName( + String project, String location, String dataStore, String branch) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setBranch(branch) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationCollectionDataStoreBranchName( + String project, String location, String collection, String dataStore, String branch) { + return newProjectLocationCollectionDataStoreBranchBuilder() + .setProject(project) + .setLocation(location) + .setCollection(collection) + .setDataStore(dataStore) + .setBranch(branch) + .build() + .toString(); + } + + public static BranchName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_DATA_STORE_BRANCH.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_DATA_STORE_BRANCH.match(formattedString); + return ofProjectLocationDataStoreBranchName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("data_store"), + matchMap.get("branch")); + } else if (PROJECT_LOCATION_COLLECTION_DATA_STORE_BRANCH.matches(formattedString)) { + Map matchMap = + PROJECT_LOCATION_COLLECTION_DATA_STORE_BRANCH.match(formattedString); + return ofProjectLocationCollectionDataStoreBranchName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("collection"), + matchMap.get("data_store"), + matchMap.get("branch")); + } + throw new ValidationException("BranchName.parse: formattedString not in valid format"); + } + + 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_DATA_STORE_BRANCH.matches(formattedString) + || PROJECT_LOCATION_COLLECTION_DATA_STORE_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 (dataStore != null) { + fieldMapBuilder.put("data_store", dataStore); + } + if (branch != null) { + fieldMapBuilder.put("branch", branch); + } + if (collection != null) { + fieldMapBuilder.put("collection", collection); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @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.dataStore, that.dataStore) + && Objects.equals(this.branch, that.branch) + && Objects.equals(this.collection, that.collection); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(dataStore); + h *= 1000003; + h ^= Objects.hashCode(branch); + h *= 1000003; + h ^= Objects.hashCode(collection); + return h; + } + + /** + * Builder for projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}. + */ + public static class Builder { + private String project; + private String location; + private String dataStore; + private String branch; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataStore() { + return dataStore; + } + + 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 setDataStore(String dataStore) { + this.dataStore = dataStore; + return this; + } + + public Builder setBranch(String branch) { + this.branch = branch; + return this; + } + + private Builder(BranchName branchName) { + Preconditions.checkArgument( + Objects.equals(branchName.pathTemplate, PROJECT_LOCATION_DATA_STORE_BRANCH), + "toBuilder is only supported when BranchName has the pattern of projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}"); + this.project = branchName.project; + this.location = branchName.location; + this.dataStore = branchName.dataStore; + this.branch = branchName.branch; + } + + public BranchName build() { + return new BranchName(this); + } + } + + /** + * Builder for + * projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}. + */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class ProjectLocationCollectionDataStoreBranchBuilder { + private String project; + private String location; + private String collection; + private String dataStore; + private String branch; + + protected ProjectLocationCollectionDataStoreBranchBuilder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCollection() { + return collection; + } + + public String getDataStore() { + return dataStore; + } + + public String getBranch() { + return branch; + } + + public ProjectLocationCollectionDataStoreBranchBuilder setProject(String project) { + this.project = project; + return this; + } + + public ProjectLocationCollectionDataStoreBranchBuilder setLocation(String location) { + this.location = location; + return this; + } + + public ProjectLocationCollectionDataStoreBranchBuilder setCollection(String collection) { + this.collection = collection; + return this; + } + + public ProjectLocationCollectionDataStoreBranchBuilder setDataStore(String dataStore) { + this.dataStore = dataStore; + return this; + } + + public ProjectLocationCollectionDataStoreBranchBuilder setBranch(String branch) { + this.branch = branch; + return this; + } + + public BranchName build() { + return new BranchName(this); + } + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CollectUserEventRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CollectUserEventRequest.java new file mode 100644 index 000000000000..7ea277a59dc5 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CollectUserEventRequest.java @@ -0,0 +1,1230 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/user_event_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request message for CollectUserEvent method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.CollectUserEventRequest} + */ +public final class CollectUserEventRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.UserEventServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CollectUserEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.UserEventServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CollectUserEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest.class, + com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent DataStore resource name, such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+   * 
+ * + * + * 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 DataStore resource name, such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+   * 
+ * + * + * 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 USER_EVENT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + 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; + + @SuppressWarnings("serial") + 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 third-party
+   * requests.
+   * 
+ * + * optional string uri = 3; + * + * @return Whether the uri field is set. + */ + @java.lang.Override + public boolean hasUri() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * 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 third-party
+   * requests.
+   * 
+ * + * optional 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 third-party
+   * requests.
+   * 
+ * + * optional 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_ = 0L; + /** + * + * + *
+   * The event timestamp in milliseconds. This prevents browser caching of
+   * otherwise identical get requests. The name is abbreviated to reduce the
+   * payload bytes.
+   * 
+ * + * optional int64 ets = 4; + * + * @return Whether the ets field is set. + */ + @java.lang.Override + public boolean hasEts() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The event timestamp in milliseconds. This prevents browser caching of
+   * otherwise identical get requests. The name is abbreviated to reduce the
+   * payload bytes.
+   * 
+ * + * optional 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 (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uri_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt64(4, ets_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(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 (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uri_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, ets_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest other = + (com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getUserEvent().equals(other.getUserEvent())) return false; + if (hasUri() != other.hasUri()) return false; + if (hasUri()) { + if (!getUri().equals(other.getUri())) return false; + } + if (hasEts() != other.hasEts()) return false; + if (hasEts()) { + if (getEts() != other.getEts()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + USER_EVENT_FIELD_NUMBER; + hash = (53 * hash) + getUserEvent().hashCode(); + if (hasUri()) { + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + } + if (hasEts()) { + hash = (37 * hash) + ETS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getEts()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.CollectUserEventRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.CollectUserEventRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.CollectUserEventRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.CollectUserEventRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.CollectUserEventRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.CollectUserEventRequest) + com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.UserEventServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CollectUserEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.UserEventServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CollectUserEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest.class, + com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + userEvent_ = ""; + uri_ = ""; + ets_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.UserEventServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CollectUserEventRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest build() { + com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest result = + new com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.userEvent_ = userEvent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.uri_ = uri_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.ets_ = ets_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUserEvent().isEmpty()) { + userEvent_ = other.userEvent_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasUri()) { + uri_ = other.uri_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasEts()) { + setEts(other.getEts()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + userEvent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + uri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + ets_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent DataStore resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+     * 
+ * + * + * 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 DataStore resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+     * 
+ * + * + * 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 DataStore resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent DataStore resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent DataStore resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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; + bitField0_ |= 0x00000002; + 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(); + bitField0_ = (bitField0_ & ~0x00000002); + 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; + bitField0_ |= 0x00000002; + 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 third-party
+     * requests.
+     * 
+ * + * optional string uri = 3; + * + * @return Whether the uri field is set. + */ + public boolean hasUri() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * 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 third-party
+     * requests.
+     * 
+ * + * optional 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 third-party
+     * requests.
+     * 
+ * + * optional 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 third-party
+     * requests.
+     * 
+ * + * optional 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; + bitField0_ |= 0x00000004; + 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 third-party
+     * requests.
+     * 
+ * + * optional string uri = 3; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + uri_ = getDefaultInstance().getUri(); + bitField0_ = (bitField0_ & ~0x00000004); + 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 third-party
+     * requests.
+     * 
+ * + * optional 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; + bitField0_ |= 0x00000004; + 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.
+     * 
+ * + * optional int64 ets = 4; + * + * @return Whether the ets field is set. + */ + @java.lang.Override + public boolean hasEts() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * The event timestamp in milliseconds. This prevents browser caching of
+     * otherwise identical get requests. The name is abbreviated to reduce the
+     * payload bytes.
+     * 
+ * + * optional 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.
+     * 
+ * + * optional int64 ets = 4; + * + * @param value The ets to set. + * @return This builder for chaining. + */ + public Builder setEts(long value) { + + ets_ = value; + bitField0_ |= 0x00000008; + 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.
+     * 
+ * + * optional int64 ets = 4; + * + * @return This builder for chaining. + */ + public Builder clearEts() { + bitField0_ = (bitField0_ & ~0x00000008); + 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.discoveryengine.v1alpha.CollectUserEventRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.CollectUserEventRequest) + private static final com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CollectUserEventRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CollectUserEventRequestOrBuilder.java new file mode 100644 index 000000000000..44cf8b037343 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CollectUserEventRequestOrBuilder.java @@ -0,0 +1,158 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/user_event_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface CollectUserEventRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.CollectUserEventRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent DataStore resource name, such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent DataStore resource name, such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 third-party
+   * requests.
+   * 
+ * + * optional string uri = 3; + * + * @return Whether the uri field is set. + */ + boolean hasUri(); + /** + * + * + *
+   * 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 third-party
+   * requests.
+   * 
+ * + * optional 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 third-party
+   * requests.
+   * 
+ * + * optional 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.
+   * 
+ * + * optional int64 ets = 4; + * + * @return Whether the ets field is set. + */ + boolean hasEts(); + /** + * + * + *
+   * The event timestamp in milliseconds. This prevents browser caching of
+   * otherwise identical get requests. The name is abbreviated to reduce the
+   * payload bytes.
+   * 
+ * + * optional int64 ets = 4; + * + * @return The ets. + */ + long getEts(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CommonProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CommonProto.java new file mode 100644 index 000000000000..d7b44cc7fb49 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CommonProto.java @@ -0,0 +1,150 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/common.proto + +package com.google.cloud.discoveryengine.v1alpha; + +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_discoveryengine_v1alpha_Interval_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_Interval_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_CustomAttribute_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_CustomAttribute_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_UserInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_UserInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_DoubleList_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_DoubleList_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/discoveryengine/v1alpha/c" + + "ommon.proto\022$google.cloud.discoveryengin" + + "e.v1alpha\032\031google/api/resource.proto\"x\n\010" + + "Interval\022\021\n\007minimum\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\021e" + + "xclusive_maximum\030\004 \001(\001H\001B\005\n\003minB\005\n\003max\"0" + + "\n\017CustomAttribute\022\014\n\004text\030\001 \003(\t\022\017\n\007numbe" + + "rs\030\002 \003(\001\"/\n\010UserInfo\022\017\n\007user_id\030\001 \001(\t\022\022\n" + + "\nuser_agent\030\002 \001(\t\"\034\n\nDoubleList\022\016\n\006value" + + "s\030\001 \003(\001*\201\001\n\014SolutionType\022\035\n\031SOLUTION_TYP" + + "E_UNSPECIFIED\020\000\022 \n\034SOLUTION_TYPE_RECOMME" + + "NDATION\020\001\022\030\n\024SOLUTION_TYPE_SEARCH\020\002\022\026\n\022S" + + "OLUTION_TYPE_CHAT\020\003B\274\n\n(com.google.cloud" + + ".discoveryengine.v1alphaB\013CommonProtoP\001Z" + + "Rcloud.google.com/go/discoveryengine/api" + + "v1alpha/discoveryenginepb;discoveryengin" + + "epb\242\002\017DISCOVERYENGINE\252\002$Google.Cloud.Dis" + + "coveryEngine.V1Alpha\312\002$Google\\Cloud\\Disc" + + "overyEngine\\V1alpha\352\002\'Google::Cloud::Dis" + + "coveryEngine::V1alpha\352A\346\001\n%discoveryengi" + + "ne.googleapis.com/Branch\022Qprojects/{proj" + + "ect}/locations/{location}/dataStores/{da" + + "ta_store}/branches/{branch}\022jprojects/{p" + + "roject}/locations/{location}/collections" + + "/{collection}/dataStores/{data_store}/br" + + "anches/{branch}\352A\305\001\n(discoveryengine.goo" + + "gleapis.com/DataStore\022?projects/{project" + + "}/locations/{location}/dataStores/{data_" + + "store}\022Xprojects/{project}/locations/{lo" + + "cation}/collections/{collection}/dataSto" + + "res/{data_store}\352A\374\002\n,discoveryengine.go" + + "ogleapis.com/ServingConfig\022_projects/{pr" + + "oject}/locations/{location}/dataStores/{" + + "data_store}/servingConfigs/{serving_conf" + + "ig}\022xprojects/{project}/locations/{locat" + + "ion}/collections/{collection}/dataStores" + + "/{data_store}/servingConfigs/{serving_co" + + "nfig}\022qprojects/{project}/locations/{loc" + + "ation}/collections/{collection}/engines/" + + "{engine}/servingConfigs/{serving_config}" + + "\352A\356\001\n/discoveryengine.googleapis.com/Sit" + + "eSearchEngine\022Pprojects/{project}/locati" + + "ons/{location}/dataStores/{data_store}/s" + + "iteSearchEngine\022iprojects/{project}/loca" + + "tions/{location}/collections/{collection" + + "}/dataStores/{data_store}/siteSearchEngi" + + "neb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.ResourceProto.getDescriptor(), + }); + internal_static_google_cloud_discoveryengine_v1alpha_Interval_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_discoveryengine_v1alpha_Interval_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_Interval_descriptor, + new java.lang.String[] { + "Minimum", "ExclusiveMinimum", "Maximum", "ExclusiveMaximum", "Min", "Max", + }); + internal_static_google_cloud_discoveryengine_v1alpha_CustomAttribute_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_discoveryengine_v1alpha_CustomAttribute_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_CustomAttribute_descriptor, + new java.lang.String[] { + "Text", "Numbers", + }); + internal_static_google_cloud_discoveryengine_v1alpha_UserInfo_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_discoveryengine_v1alpha_UserInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_UserInfo_descriptor, + new java.lang.String[] { + "UserId", "UserAgent", + }); + internal_static_google_cloud_discoveryengine_v1alpha_DoubleList_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_discoveryengine_v1alpha_DoubleList_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_DoubleList_descriptor, + new java.lang.String[] { + "Values", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ResourceProto.resourceDefinition); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.ResourceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompleteQueryRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompleteQueryRequest.java new file mode 100644 index 000000000000..89d25e7ceb26 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompleteQueryRequest.java @@ -0,0 +1,1515 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/completion_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request message for
+ * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.CompleteQueryRequest} + */ +public final class CompleteQueryRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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() { + dataStore_ = ""; + query_ = ""; + queryModel_ = ""; + userPseudoId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CompleteQueryRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.CompletionServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.CompletionServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest.class, + com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest.Builder.class); + } + + public static final int DATA_STORE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object dataStore_ = ""; + /** + * + * + *
+   * Required. The parent data store resource name for which the completion is
+   * performed, such as
+   * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.
+   * 
+ * + * + * string data_store = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The dataStore. + */ + @java.lang.Override + public java.lang.String getDataStore() { + java.lang.Object ref = dataStore_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dataStore_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent data store resource name for which the completion is
+   * performed, such as
+   * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.
+   * 
+ * + * + * string data_store = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for dataStore. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDataStoreBytes() { + java.lang.Object ref = dataStore_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dataStore_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object query_ = ""; + /** + * + * + *
+   * Required. The typeahead input used to fetch suggestions. Maximum length is
+   * 128 characters.
+   * 
+ * + * 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 typeahead input used to fetch suggestions. Maximum length is
+   * 128 characters.
+   * 
+ * + * 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 QUERY_MODEL_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object queryModel_ = ""; + /** + * + * + *
+   * Selects data model of query suggestions for serving. Currently supported
+   * values:
+   *
+   * * `document` - Using suggestions generated from user-imported documents.
+   * * `search-history` - Using suggestions generated from the past history of
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+   * API calls. Do not use it when there is no traffic for Search API.
+   * * `user-event` - Using suggestions generated from user-imported search
+   * events.
+   * * `document-completable` - Using suggestions taken directly from
+   * user-imported document fields marked as completable.
+   *
+   * Default values:
+   *
+   * * `document` is the default model for regular dataStores.
+   * * `search-history` is the default model for site search dataStores.
+   * 
+ * + * string query_model = 3; + * + * @return The queryModel. + */ + @java.lang.Override + public java.lang.String getQueryModel() { + java.lang.Object ref = queryModel_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + queryModel_ = s; + return s; + } + } + /** + * + * + *
+   * Selects data model of query suggestions for serving. Currently supported
+   * values:
+   *
+   * * `document` - Using suggestions generated from user-imported documents.
+   * * `search-history` - Using suggestions generated from the past history of
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+   * API calls. Do not use it when there is no traffic for Search API.
+   * * `user-event` - Using suggestions generated from user-imported search
+   * events.
+   * * `document-completable` - Using suggestions taken directly from
+   * user-imported document fields marked as completable.
+   *
+   * Default values:
+   *
+   * * `document` is the default model for regular dataStores.
+   * * `search-history` is the default model for site search dataStores.
+   * 
+ * + * string query_model = 3; + * + * @return The bytes for queryModel. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryModelBytes() { + java.lang.Object ref = queryModel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + queryModel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_PSEUDO_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object userPseudoId_ = ""; + /** + * + * + *
+   * 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 field should NOT have a fixed value such as `unknown_visitor`.
+   *
+   * This should be the same identifier as
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * and
+   * [SearchRequest.user_pseudo_id][google.cloud.discoveryengine.v1alpha.SearchRequest.user_pseudo_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_pseudo_id = 4; + * + * @return The userPseudoId. + */ + @java.lang.Override + public java.lang.String getUserPseudoId() { + java.lang.Object ref = userPseudoId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userPseudoId_ = s; + return s; + } + } + /** + * + * + *
+   * 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 field should NOT have a fixed value such as `unknown_visitor`.
+   *
+   * This should be the same identifier as
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * and
+   * [SearchRequest.user_pseudo_id][google.cloud.discoveryengine.v1alpha.SearchRequest.user_pseudo_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_pseudo_id = 4; + * + * @return The bytes for userPseudoId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserPseudoIdBytes() { + java.lang.Object ref = userPseudoId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userPseudoId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INCLUDE_TAIL_SUGGESTIONS_FIELD_NUMBER = 5; + private boolean includeTailSuggestions_ = false; + /** + * + * + *
+   * Indicates if tail suggestions should be returned if there are no
+   * suggestions that match the full query. Even if set to true, if there are
+   * suggestions that match the full query, those are returned and no
+   * tail suggestions are returned.
+   * 
+ * + * bool include_tail_suggestions = 5; + * + * @return The includeTailSuggestions. + */ + @java.lang.Override + public boolean getIncludeTailSuggestions() { + return includeTailSuggestions_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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(dataStore_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, dataStore_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, query_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(queryModel_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, queryModel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userPseudoId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, userPseudoId_); + } + if (includeTailSuggestions_ != false) { + output.writeBool(5, includeTailSuggestions_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataStore_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, dataStore_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, query_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(queryModel_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, queryModel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userPseudoId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, userPseudoId_); + } + if (includeTailSuggestions_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, includeTailSuggestions_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest other = + (com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest) obj; + + if (!getDataStore().equals(other.getDataStore())) return false; + if (!getQuery().equals(other.getQuery())) return false; + if (!getQueryModel().equals(other.getQueryModel())) return false; + if (!getUserPseudoId().equals(other.getUserPseudoId())) return false; + if (getIncludeTailSuggestions() != other.getIncludeTailSuggestions()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DATA_STORE_FIELD_NUMBER; + hash = (53 * hash) + getDataStore().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (37 * hash) + QUERY_MODEL_FIELD_NUMBER; + hash = (53 * hash) + getQueryModel().hashCode(); + hash = (37 * hash) + USER_PSEUDO_ID_FIELD_NUMBER; + hash = (53 * hash) + getUserPseudoId().hashCode(); + hash = (37 * hash) + INCLUDE_TAIL_SUGGESTIONS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIncludeTailSuggestions()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.CompleteQueryRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.CompleteQueryRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.CompleteQueryRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.CompleteQueryRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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; + } + /** + * + * + *
+   * Request message for
+   * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.CompleteQueryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.CompleteQueryRequest) + com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.CompletionServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.CompletionServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest.class, + com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dataStore_ = ""; + query_ = ""; + queryModel_ = ""; + userPseudoId_ = ""; + includeTailSuggestions_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.CompletionServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest build() { + com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest result = + new com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dataStore_ = dataStore_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.query_ = query_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.queryModel_ = queryModel_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.userPseudoId_ = userPseudoId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.includeTailSuggestions_ = includeTailSuggestions_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest.getDefaultInstance()) + return this; + if (!other.getDataStore().isEmpty()) { + dataStore_ = other.dataStore_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getQueryModel().isEmpty()) { + queryModel_ = other.queryModel_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getUserPseudoId().isEmpty()) { + userPseudoId_ = other.userPseudoId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getIncludeTailSuggestions() != false) { + setIncludeTailSuggestions(other.getIncludeTailSuggestions()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + dataStore_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + query_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + queryModel_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + userPseudoId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + includeTailSuggestions_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object dataStore_ = ""; + /** + * + * + *
+     * Required. The parent data store resource name for which the completion is
+     * performed, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.
+     * 
+ * + * + * string data_store = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The dataStore. + */ + public java.lang.String getDataStore() { + java.lang.Object ref = dataStore_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dataStore_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent data store resource name for which the completion is
+     * performed, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.
+     * 
+ * + * + * string data_store = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for dataStore. + */ + public com.google.protobuf.ByteString getDataStoreBytes() { + java.lang.Object ref = dataStore_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dataStore_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent data store resource name for which the completion is
+     * performed, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.
+     * 
+ * + * + * string data_store = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The dataStore to set. + * @return This builder for chaining. + */ + public Builder setDataStore(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dataStore_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent data store resource name for which the completion is
+     * performed, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.
+     * 
+ * + * + * string data_store = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearDataStore() { + dataStore_ = getDefaultInstance().getDataStore(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent data store resource name for which the completion is
+     * performed, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.
+     * 
+ * + * + * string data_store = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for dataStore to set. + * @return This builder for chaining. + */ + public Builder setDataStoreBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dataStore_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object query_ = ""; + /** + * + * + *
+     * Required. The typeahead input used to fetch suggestions. Maximum length is
+     * 128 characters.
+     * 
+ * + * 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 typeahead input used to fetch suggestions. Maximum length is
+     * 128 characters.
+     * 
+ * + * 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 typeahead input used to fetch suggestions. Maximum length is
+     * 128 characters.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The typeahead input used to fetch suggestions. Maximum length is
+     * 128 characters.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + query_ = getDefaultInstance().getQuery(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The typeahead input used to fetch suggestions. Maximum length is
+     * 128 characters.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object queryModel_ = ""; + /** + * + * + *
+     * Selects data model of query suggestions for serving. Currently supported
+     * values:
+     *
+     * * `document` - Using suggestions generated from user-imported documents.
+     * * `search-history` - Using suggestions generated from the past history of
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * API calls. Do not use it when there is no traffic for Search API.
+     * * `user-event` - Using suggestions generated from user-imported search
+     * events.
+     * * `document-completable` - Using suggestions taken directly from
+     * user-imported document fields marked as completable.
+     *
+     * Default values:
+     *
+     * * `document` is the default model for regular dataStores.
+     * * `search-history` is the default model for site search dataStores.
+     * 
+ * + * string query_model = 3; + * + * @return The queryModel. + */ + public java.lang.String getQueryModel() { + java.lang.Object ref = queryModel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + queryModel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Selects data model of query suggestions for serving. Currently supported
+     * values:
+     *
+     * * `document` - Using suggestions generated from user-imported documents.
+     * * `search-history` - Using suggestions generated from the past history of
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * API calls. Do not use it when there is no traffic for Search API.
+     * * `user-event` - Using suggestions generated from user-imported search
+     * events.
+     * * `document-completable` - Using suggestions taken directly from
+     * user-imported document fields marked as completable.
+     *
+     * Default values:
+     *
+     * * `document` is the default model for regular dataStores.
+     * * `search-history` is the default model for site search dataStores.
+     * 
+ * + * string query_model = 3; + * + * @return The bytes for queryModel. + */ + public com.google.protobuf.ByteString getQueryModelBytes() { + java.lang.Object ref = queryModel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + queryModel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Selects data model of query suggestions for serving. Currently supported
+     * values:
+     *
+     * * `document` - Using suggestions generated from user-imported documents.
+     * * `search-history` - Using suggestions generated from the past history of
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * API calls. Do not use it when there is no traffic for Search API.
+     * * `user-event` - Using suggestions generated from user-imported search
+     * events.
+     * * `document-completable` - Using suggestions taken directly from
+     * user-imported document fields marked as completable.
+     *
+     * Default values:
+     *
+     * * `document` is the default model for regular dataStores.
+     * * `search-history` is the default model for site search dataStores.
+     * 
+ * + * string query_model = 3; + * + * @param value The queryModel to set. + * @return This builder for chaining. + */ + public Builder setQueryModel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + queryModel_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Selects data model of query suggestions for serving. Currently supported
+     * values:
+     *
+     * * `document` - Using suggestions generated from user-imported documents.
+     * * `search-history` - Using suggestions generated from the past history of
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * API calls. Do not use it when there is no traffic for Search API.
+     * * `user-event` - Using suggestions generated from user-imported search
+     * events.
+     * * `document-completable` - Using suggestions taken directly from
+     * user-imported document fields marked as completable.
+     *
+     * Default values:
+     *
+     * * `document` is the default model for regular dataStores.
+     * * `search-history` is the default model for site search dataStores.
+     * 
+ * + * string query_model = 3; + * + * @return This builder for chaining. + */ + public Builder clearQueryModel() { + queryModel_ = getDefaultInstance().getQueryModel(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Selects data model of query suggestions for serving. Currently supported
+     * values:
+     *
+     * * `document` - Using suggestions generated from user-imported documents.
+     * * `search-history` - Using suggestions generated from the past history of
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * API calls. Do not use it when there is no traffic for Search API.
+     * * `user-event` - Using suggestions generated from user-imported search
+     * events.
+     * * `document-completable` - Using suggestions taken directly from
+     * user-imported document fields marked as completable.
+     *
+     * Default values:
+     *
+     * * `document` is the default model for regular dataStores.
+     * * `search-history` is the default model for site search dataStores.
+     * 
+ * + * string query_model = 3; + * + * @param value The bytes for queryModel to set. + * @return This builder for chaining. + */ + public Builder setQueryModelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + queryModel_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object userPseudoId_ = ""; + /** + * + * + *
+     * 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 field should NOT have a fixed value such as `unknown_visitor`.
+     *
+     * This should be the same identifier as
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * and
+     * [SearchRequest.user_pseudo_id][google.cloud.discoveryengine.v1alpha.SearchRequest.user_pseudo_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_pseudo_id = 4; + * + * @return The userPseudoId. + */ + public java.lang.String getUserPseudoId() { + java.lang.Object ref = userPseudoId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userPseudoId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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 field should NOT have a fixed value such as `unknown_visitor`.
+     *
+     * This should be the same identifier as
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * and
+     * [SearchRequest.user_pseudo_id][google.cloud.discoveryengine.v1alpha.SearchRequest.user_pseudo_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_pseudo_id = 4; + * + * @return The bytes for userPseudoId. + */ + public com.google.protobuf.ByteString getUserPseudoIdBytes() { + java.lang.Object ref = userPseudoId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userPseudoId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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 field should NOT have a fixed value such as `unknown_visitor`.
+     *
+     * This should be the same identifier as
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * and
+     * [SearchRequest.user_pseudo_id][google.cloud.discoveryengine.v1alpha.SearchRequest.user_pseudo_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_pseudo_id = 4; + * + * @param value The userPseudoId to set. + * @return This builder for chaining. + */ + public Builder setUserPseudoId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + userPseudoId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * 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 field should NOT have a fixed value such as `unknown_visitor`.
+     *
+     * This should be the same identifier as
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * and
+     * [SearchRequest.user_pseudo_id][google.cloud.discoveryengine.v1alpha.SearchRequest.user_pseudo_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_pseudo_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearUserPseudoId() { + userPseudoId_ = getDefaultInstance().getUserPseudoId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * 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 field should NOT have a fixed value such as `unknown_visitor`.
+     *
+     * This should be the same identifier as
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * and
+     * [SearchRequest.user_pseudo_id][google.cloud.discoveryengine.v1alpha.SearchRequest.user_pseudo_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_pseudo_id = 4; + * + * @param value The bytes for userPseudoId to set. + * @return This builder for chaining. + */ + public Builder setUserPseudoIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + userPseudoId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean includeTailSuggestions_; + /** + * + * + *
+     * Indicates if tail suggestions should be returned if there are no
+     * suggestions that match the full query. Even if set to true, if there are
+     * suggestions that match the full query, those are returned and no
+     * tail suggestions are returned.
+     * 
+ * + * bool include_tail_suggestions = 5; + * + * @return The includeTailSuggestions. + */ + @java.lang.Override + public boolean getIncludeTailSuggestions() { + return includeTailSuggestions_; + } + /** + * + * + *
+     * Indicates if tail suggestions should be returned if there are no
+     * suggestions that match the full query. Even if set to true, if there are
+     * suggestions that match the full query, those are returned and no
+     * tail suggestions are returned.
+     * 
+ * + * bool include_tail_suggestions = 5; + * + * @param value The includeTailSuggestions to set. + * @return This builder for chaining. + */ + public Builder setIncludeTailSuggestions(boolean value) { + + includeTailSuggestions_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates if tail suggestions should be returned if there are no
+     * suggestions that match the full query. Even if set to true, if there are
+     * suggestions that match the full query, those are returned and no
+     * tail suggestions are returned.
+     * 
+ * + * bool include_tail_suggestions = 5; + * + * @return This builder for chaining. + */ + public Builder clearIncludeTailSuggestions() { + bitField0_ = (bitField0_ & ~0x00000010); + includeTailSuggestions_ = 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.discoveryengine.v1alpha.CompleteQueryRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.CompleteQueryRequest) + private static final com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompleteQueryRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompleteQueryRequestOrBuilder.java new file mode 100644 index 000000000000..d03d8a242750 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompleteQueryRequestOrBuilder.java @@ -0,0 +1,207 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/completion_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface CompleteQueryRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.CompleteQueryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent data store resource name for which the completion is
+   * performed, such as
+   * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.
+   * 
+ * + * + * string data_store = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The dataStore. + */ + java.lang.String getDataStore(); + /** + * + * + *
+   * Required. The parent data store resource name for which the completion is
+   * performed, such as
+   * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.
+   * 
+ * + * + * string data_store = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for dataStore. + */ + com.google.protobuf.ByteString getDataStoreBytes(); + + /** + * + * + *
+   * Required. The typeahead input used to fetch suggestions. Maximum length is
+   * 128 characters.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + java.lang.String getQuery(); + /** + * + * + *
+   * Required. The typeahead input used to fetch suggestions. Maximum length is
+   * 128 characters.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
+   * Selects data model of query suggestions for serving. Currently supported
+   * values:
+   *
+   * * `document` - Using suggestions generated from user-imported documents.
+   * * `search-history` - Using suggestions generated from the past history of
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+   * API calls. Do not use it when there is no traffic for Search API.
+   * * `user-event` - Using suggestions generated from user-imported search
+   * events.
+   * * `document-completable` - Using suggestions taken directly from
+   * user-imported document fields marked as completable.
+   *
+   * Default values:
+   *
+   * * `document` is the default model for regular dataStores.
+   * * `search-history` is the default model for site search dataStores.
+   * 
+ * + * string query_model = 3; + * + * @return The queryModel. + */ + java.lang.String getQueryModel(); + /** + * + * + *
+   * Selects data model of query suggestions for serving. Currently supported
+   * values:
+   *
+   * * `document` - Using suggestions generated from user-imported documents.
+   * * `search-history` - Using suggestions generated from the past history of
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+   * API calls. Do not use it when there is no traffic for Search API.
+   * * `user-event` - Using suggestions generated from user-imported search
+   * events.
+   * * `document-completable` - Using suggestions taken directly from
+   * user-imported document fields marked as completable.
+   *
+   * Default values:
+   *
+   * * `document` is the default model for regular dataStores.
+   * * `search-history` is the default model for site search dataStores.
+   * 
+ * + * string query_model = 3; + * + * @return The bytes for queryModel. + */ + com.google.protobuf.ByteString getQueryModelBytes(); + + /** + * + * + *
+   * 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 field should NOT have a fixed value such as `unknown_visitor`.
+   *
+   * This should be the same identifier as
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * and
+   * [SearchRequest.user_pseudo_id][google.cloud.discoveryengine.v1alpha.SearchRequest.user_pseudo_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_pseudo_id = 4; + * + * @return The userPseudoId. + */ + java.lang.String getUserPseudoId(); + /** + * + * + *
+   * 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 field should NOT have a fixed value such as `unknown_visitor`.
+   *
+   * This should be the same identifier as
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * and
+   * [SearchRequest.user_pseudo_id][google.cloud.discoveryengine.v1alpha.SearchRequest.user_pseudo_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_pseudo_id = 4; + * + * @return The bytes for userPseudoId. + */ + com.google.protobuf.ByteString getUserPseudoIdBytes(); + + /** + * + * + *
+   * Indicates if tail suggestions should be returned if there are no
+   * suggestions that match the full query. Even if set to true, if there are
+   * suggestions that match the full query, those are returned and no
+   * tail suggestions are returned.
+   * 
+ * + * bool include_tail_suggestions = 5; + * + * @return The includeTailSuggestions. + */ + boolean getIncludeTailSuggestions(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompleteQueryResponse.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompleteQueryResponse.java new file mode 100644 index 000000000000..c1de6156ae46 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompleteQueryResponse.java @@ -0,0 +1,2226 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/completion_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Response message for
+ * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.CompleteQueryResponse} + */ +public final class CompleteQueryResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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() { + querySuggestions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CompleteQueryResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.CompletionServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.CompletionServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.class, + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.Builder.class); + } + + public interface QuerySuggestionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion) + 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(); + + /** + * + * + *
+     * The unique document field paths that serve as the source of this
+     * suggestion if it was generated from completable fields.
+     *
+     * This field is only populated for the document-completable model.
+     * 
+ * + * repeated string completable_field_paths = 2; + * + * @return A list containing the completableFieldPaths. + */ + java.util.List getCompletableFieldPathsList(); + /** + * + * + *
+     * The unique document field paths that serve as the source of this
+     * suggestion if it was generated from completable fields.
+     *
+     * This field is only populated for the document-completable model.
+     * 
+ * + * repeated string completable_field_paths = 2; + * + * @return The count of completableFieldPaths. + */ + int getCompletableFieldPathsCount(); + /** + * + * + *
+     * The unique document field paths that serve as the source of this
+     * suggestion if it was generated from completable fields.
+     *
+     * This field is only populated for the document-completable model.
+     * 
+ * + * repeated string completable_field_paths = 2; + * + * @param index The index of the element to return. + * @return The completableFieldPaths at the given index. + */ + java.lang.String getCompletableFieldPaths(int index); + /** + * + * + *
+     * The unique document field paths that serve as the source of this
+     * suggestion if it was generated from completable fields.
+     *
+     * This field is only populated for the document-completable model.
+     * 
+ * + * repeated string completable_field_paths = 2; + * + * @param index The index of the value to return. + * @return The bytes of the completableFieldPaths at the given index. + */ + com.google.protobuf.ByteString getCompletableFieldPathsBytes(int index); + } + /** + * + * + *
+   * Suggestions as search queries.
+   * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion} + */ + public static final class QuerySuggestion extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion) + QuerySuggestionOrBuilder { + private static final long serialVersionUID = 0L; + // Use QuerySuggestion.newBuilder() to construct. + private QuerySuggestion(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QuerySuggestion() { + suggestion_ = ""; + completableFieldPaths_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QuerySuggestion(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.CompletionServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryResponse_QuerySuggestion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.CompletionServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryResponse_QuerySuggestion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.class, + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.Builder + .class); + } + + public static final int SUGGESTION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + 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 COMPLETABLE_FIELD_PATHS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList completableFieldPaths_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+     * The unique document field paths that serve as the source of this
+     * suggestion if it was generated from completable fields.
+     *
+     * This field is only populated for the document-completable model.
+     * 
+ * + * repeated string completable_field_paths = 2; + * + * @return A list containing the completableFieldPaths. + */ + public com.google.protobuf.ProtocolStringList getCompletableFieldPathsList() { + return completableFieldPaths_; + } + /** + * + * + *
+     * The unique document field paths that serve as the source of this
+     * suggestion if it was generated from completable fields.
+     *
+     * This field is only populated for the document-completable model.
+     * 
+ * + * repeated string completable_field_paths = 2; + * + * @return The count of completableFieldPaths. + */ + public int getCompletableFieldPathsCount() { + return completableFieldPaths_.size(); + } + /** + * + * + *
+     * The unique document field paths that serve as the source of this
+     * suggestion if it was generated from completable fields.
+     *
+     * This field is only populated for the document-completable model.
+     * 
+ * + * repeated string completable_field_paths = 2; + * + * @param index The index of the element to return. + * @return The completableFieldPaths at the given index. + */ + public java.lang.String getCompletableFieldPaths(int index) { + return completableFieldPaths_.get(index); + } + /** + * + * + *
+     * The unique document field paths that serve as the source of this
+     * suggestion if it was generated from completable fields.
+     *
+     * This field is only populated for the document-completable model.
+     * 
+ * + * repeated string completable_field_paths = 2; + * + * @param index The index of the value to return. + * @return The bytes of the completableFieldPaths at the given index. + */ + public com.google.protobuf.ByteString getCompletableFieldPathsBytes(int index) { + return completableFieldPaths_.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(suggestion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, suggestion_); + } + for (int i = 0; i < completableFieldPaths_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 2, completableFieldPaths_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(suggestion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, suggestion_); + } + { + int dataSize = 0; + for (int i = 0; i < completableFieldPaths_.size(); i++) { + dataSize += computeStringSizeNoTag(completableFieldPaths_.getRaw(i)); + } + size += dataSize; + size += 1 * getCompletableFieldPathsList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion other = + (com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion) obj; + + if (!getSuggestion().equals(other.getSuggestion())) return false; + if (!getCompletableFieldPathsList().equals(other.getCompletableFieldPathsList())) + return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SUGGESTION_FIELD_NUMBER; + hash = (53 * hash) + getSuggestion().hashCode(); + if (getCompletableFieldPathsCount() > 0) { + hash = (37 * hash) + COMPLETABLE_FIELD_PATHS_FIELD_NUMBER; + hash = (53 * hash) + getCompletableFieldPathsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Suggestions as search queries.
+     * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion) + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.CompletionServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryResponse_QuerySuggestion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.CompletionServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryResponse_QuerySuggestion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + .class, + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + .Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + suggestion_ = ""; + completableFieldPaths_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.CompletionServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryResponse_QuerySuggestion_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + build() { + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + buildPartial() { + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion result = + new com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.suggestion_ = suggestion_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + completableFieldPaths_.makeImmutable(); + result.completableFieldPaths_ = completableFieldPaths_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + .getDefaultInstance()) return this; + if (!other.getSuggestion().isEmpty()) { + suggestion_ = other.suggestion_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.completableFieldPaths_.isEmpty()) { + if (completableFieldPaths_.isEmpty()) { + completableFieldPaths_ = other.completableFieldPaths_; + bitField0_ |= 0x00000002; + } else { + ensureCompletableFieldPathsIsMutable(); + completableFieldPaths_.addAll(other.completableFieldPaths_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + suggestion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureCompletableFieldPathsIsMutable(); + completableFieldPaths_.add(s); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The suggestion for the query.
+       * 
+ * + * string suggestion = 1; + * + * @return This builder for chaining. + */ + public Builder clearSuggestion() { + suggestion_ = getDefaultInstance().getSuggestion(); + bitField0_ = (bitField0_ & ~0x00000001); + 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList completableFieldPaths_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureCompletableFieldPathsIsMutable() { + if (!completableFieldPaths_.isModifiable()) { + completableFieldPaths_ = + new com.google.protobuf.LazyStringArrayList(completableFieldPaths_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+       * The unique document field paths that serve as the source of this
+       * suggestion if it was generated from completable fields.
+       *
+       * This field is only populated for the document-completable model.
+       * 
+ * + * repeated string completable_field_paths = 2; + * + * @return A list containing the completableFieldPaths. + */ + public com.google.protobuf.ProtocolStringList getCompletableFieldPathsList() { + completableFieldPaths_.makeImmutable(); + return completableFieldPaths_; + } + /** + * + * + *
+       * The unique document field paths that serve as the source of this
+       * suggestion if it was generated from completable fields.
+       *
+       * This field is only populated for the document-completable model.
+       * 
+ * + * repeated string completable_field_paths = 2; + * + * @return The count of completableFieldPaths. + */ + public int getCompletableFieldPathsCount() { + return completableFieldPaths_.size(); + } + /** + * + * + *
+       * The unique document field paths that serve as the source of this
+       * suggestion if it was generated from completable fields.
+       *
+       * This field is only populated for the document-completable model.
+       * 
+ * + * repeated string completable_field_paths = 2; + * + * @param index The index of the element to return. + * @return The completableFieldPaths at the given index. + */ + public java.lang.String getCompletableFieldPaths(int index) { + return completableFieldPaths_.get(index); + } + /** + * + * + *
+       * The unique document field paths that serve as the source of this
+       * suggestion if it was generated from completable fields.
+       *
+       * This field is only populated for the document-completable model.
+       * 
+ * + * repeated string completable_field_paths = 2; + * + * @param index The index of the value to return. + * @return The bytes of the completableFieldPaths at the given index. + */ + public com.google.protobuf.ByteString getCompletableFieldPathsBytes(int index) { + return completableFieldPaths_.getByteString(index); + } + /** + * + * + *
+       * The unique document field paths that serve as the source of this
+       * suggestion if it was generated from completable fields.
+       *
+       * This field is only populated for the document-completable model.
+       * 
+ * + * repeated string completable_field_paths = 2; + * + * @param index The index to set the value at. + * @param value The completableFieldPaths to set. + * @return This builder for chaining. + */ + public Builder setCompletableFieldPaths(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCompletableFieldPathsIsMutable(); + completableFieldPaths_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The unique document field paths that serve as the source of this
+       * suggestion if it was generated from completable fields.
+       *
+       * This field is only populated for the document-completable model.
+       * 
+ * + * repeated string completable_field_paths = 2; + * + * @param value The completableFieldPaths to add. + * @return This builder for chaining. + */ + public Builder addCompletableFieldPaths(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCompletableFieldPathsIsMutable(); + completableFieldPaths_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The unique document field paths that serve as the source of this
+       * suggestion if it was generated from completable fields.
+       *
+       * This field is only populated for the document-completable model.
+       * 
+ * + * repeated string completable_field_paths = 2; + * + * @param values The completableFieldPaths to add. + * @return This builder for chaining. + */ + public Builder addAllCompletableFieldPaths(java.lang.Iterable values) { + ensureCompletableFieldPathsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, completableFieldPaths_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The unique document field paths that serve as the source of this
+       * suggestion if it was generated from completable fields.
+       *
+       * This field is only populated for the document-completable model.
+       * 
+ * + * repeated string completable_field_paths = 2; + * + * @return This builder for chaining. + */ + public Builder clearCompletableFieldPaths() { + completableFieldPaths_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + /** + * + * + *
+       * The unique document field paths that serve as the source of this
+       * suggestion if it was generated from completable fields.
+       *
+       * This field is only populated for the document-completable model.
+       * 
+ * + * repeated string completable_field_paths = 2; + * + * @param value The bytes of the completableFieldPaths to add. + * @return This builder for chaining. + */ + public Builder addCompletableFieldPathsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCompletableFieldPathsIsMutable(); + completableFieldPaths_.add(value); + bitField0_ |= 0x00000002; + 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.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion) + private static final com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse + .QuerySuggestion + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion(); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QuerySuggestion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int QUERY_SUGGESTIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List< + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion> + querySuggestions_; + /** + * + * + *
+   * Results of the matched query suggestions. The result list is ordered and
+   * the first result is a top suggestion.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + @java.lang.Override + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion> + getQuerySuggestionsList() { + return querySuggestions_; + } + /** + * + * + *
+   * Results of the matched query suggestions. The result list is ordered and
+   * the first result is a top suggestion.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse + .QuerySuggestionOrBuilder> + getQuerySuggestionsOrBuilderList() { + return querySuggestions_; + } + /** + * + * + *
+   * Results of the matched query suggestions. The result list is ordered and
+   * the first result is a top suggestion.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + @java.lang.Override + public int getQuerySuggestionsCount() { + return querySuggestions_.size(); + } + /** + * + * + *
+   * Results of the matched query suggestions. The result list is ordered and
+   * the first result is a top suggestion.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + getQuerySuggestions(int index) { + return querySuggestions_.get(index); + } + /** + * + * + *
+   * Results of the matched query suggestions. The result list is ordered and
+   * the first result is a top suggestion.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestionOrBuilder + getQuerySuggestionsOrBuilder(int index) { + return querySuggestions_.get(index); + } + + public static final int TAIL_MATCH_TRIGGERED_FIELD_NUMBER = 2; + private boolean tailMatchTriggered_ = false; + /** + * + * + *
+   * True if the returned suggestions are all tail suggestions.
+   *
+   * For tail matching to be triggered, include_tail_suggestions in the request
+   * must be true and there must be no suggestions that match the full query.
+   * 
+ * + * bool tail_match_triggered = 2; + * + * @return The tailMatchTriggered. + */ + @java.lang.Override + public boolean getTailMatchTriggered() { + return tailMatchTriggered_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 < querySuggestions_.size(); i++) { + output.writeMessage(1, querySuggestions_.get(i)); + } + if (tailMatchTriggered_ != false) { + output.writeBool(2, tailMatchTriggered_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < querySuggestions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, querySuggestions_.get(i)); + } + if (tailMatchTriggered_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, tailMatchTriggered_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse other = + (com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse) obj; + + if (!getQuerySuggestionsList().equals(other.getQuerySuggestionsList())) return false; + if (getTailMatchTriggered() != other.getTailMatchTriggered()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getQuerySuggestionsCount() > 0) { + hash = (37 * hash) + QUERY_SUGGESTIONS_FIELD_NUMBER; + hash = (53 * hash) + getQuerySuggestionsList().hashCode(); + } + hash = (37 * hash) + TAIL_MATCH_TRIGGERED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getTailMatchTriggered()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.CompleteQueryResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.CompleteQueryResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.CompleteQueryResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.CompleteQueryResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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 message for
+   * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.CompleteQueryResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.CompleteQueryResponse) + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.CompletionServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.CompletionServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.class, + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (querySuggestionsBuilder_ == null) { + querySuggestions_ = java.util.Collections.emptyList(); + } else { + querySuggestions_ = null; + querySuggestionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + tailMatchTriggered_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.CompletionServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse build() { + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse buildPartial() { + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse result = + new com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse result) { + if (querySuggestionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + querySuggestions_ = java.util.Collections.unmodifiableList(querySuggestions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.querySuggestions_ = querySuggestions_; + } else { + result.querySuggestions_ = querySuggestionsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.tailMatchTriggered_ = tailMatchTriggered_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.getDefaultInstance()) + return this; + if (querySuggestionsBuilder_ == null) { + if (!other.querySuggestions_.isEmpty()) { + if (querySuggestions_.isEmpty()) { + querySuggestions_ = other.querySuggestions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureQuerySuggestionsIsMutable(); + querySuggestions_.addAll(other.querySuggestions_); + } + onChanged(); + } + } else { + if (!other.querySuggestions_.isEmpty()) { + if (querySuggestionsBuilder_.isEmpty()) { + querySuggestionsBuilder_.dispose(); + querySuggestionsBuilder_ = null; + querySuggestions_ = other.querySuggestions_; + bitField0_ = (bitField0_ & ~0x00000001); + querySuggestionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getQuerySuggestionsFieldBuilder() + : null; + } else { + querySuggestionsBuilder_.addAllMessages(other.querySuggestions_); + } + } + } + if (other.getTailMatchTriggered() != false) { + setTailMatchTriggered(other.getTailMatchTriggered()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse + .QuerySuggestion.parser(), + extensionRegistry); + if (querySuggestionsBuilder_ == null) { + ensureQuerySuggestionsIsMutable(); + querySuggestions_.add(m); + } else { + querySuggestionsBuilder_.addMessage(m); + } + break; + } // case 10 + case 16: + { + tailMatchTriggered_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List< + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion> + querySuggestions_ = java.util.Collections.emptyList(); + + private void ensureQuerySuggestionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + querySuggestions_ = + new java.util.ArrayList< + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion>( + querySuggestions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion, + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.Builder, + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestionOrBuilder> + querySuggestionsBuilder_; + + /** + * + * + *
+     * Results of the matched query suggestions. The result list is ordered and
+     * the first result is a top suggestion.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion> + getQuerySuggestionsList() { + if (querySuggestionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(querySuggestions_); + } else { + return querySuggestionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Results of the matched query suggestions. The result list is ordered and
+     * the first result is a top suggestion.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + public int getQuerySuggestionsCount() { + if (querySuggestionsBuilder_ == null) { + return querySuggestions_.size(); + } else { + return querySuggestionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Results of the matched query suggestions. The result list is ordered and
+     * the first result is a top suggestion.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + getQuerySuggestions(int index) { + if (querySuggestionsBuilder_ == null) { + return querySuggestions_.get(index); + } else { + return querySuggestionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Results of the matched query suggestions. The result list is ordered and
+     * the first result is a top suggestion.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + public Builder setQuerySuggestions( + int index, + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion value) { + if (querySuggestionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuerySuggestionsIsMutable(); + querySuggestions_.set(index, value); + onChanged(); + } else { + querySuggestionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Results of the matched query suggestions. The result list is ordered and
+     * the first result is a top suggestion.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + public Builder setQuerySuggestions( + int index, + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.Builder + builderForValue) { + if (querySuggestionsBuilder_ == null) { + ensureQuerySuggestionsIsMutable(); + querySuggestions_.set(index, builderForValue.build()); + onChanged(); + } else { + querySuggestionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Results of the matched query suggestions. The result list is ordered and
+     * the first result is a top suggestion.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + public Builder addQuerySuggestions( + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion value) { + if (querySuggestionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuerySuggestionsIsMutable(); + querySuggestions_.add(value); + onChanged(); + } else { + querySuggestionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Results of the matched query suggestions. The result list is ordered and
+     * the first result is a top suggestion.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + public Builder addQuerySuggestions( + int index, + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion value) { + if (querySuggestionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuerySuggestionsIsMutable(); + querySuggestions_.add(index, value); + onChanged(); + } else { + querySuggestionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Results of the matched query suggestions. The result list is ordered and
+     * the first result is a top suggestion.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + public Builder addQuerySuggestions( + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.Builder + builderForValue) { + if (querySuggestionsBuilder_ == null) { + ensureQuerySuggestionsIsMutable(); + querySuggestions_.add(builderForValue.build()); + onChanged(); + } else { + querySuggestionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Results of the matched query suggestions. The result list is ordered and
+     * the first result is a top suggestion.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + public Builder addQuerySuggestions( + int index, + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.Builder + builderForValue) { + if (querySuggestionsBuilder_ == null) { + ensureQuerySuggestionsIsMutable(); + querySuggestions_.add(index, builderForValue.build()); + onChanged(); + } else { + querySuggestionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Results of the matched query suggestions. The result list is ordered and
+     * the first result is a top suggestion.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + public Builder addAllQuerySuggestions( + java.lang.Iterable< + ? extends + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion> + values) { + if (querySuggestionsBuilder_ == null) { + ensureQuerySuggestionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, querySuggestions_); + onChanged(); + } else { + querySuggestionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Results of the matched query suggestions. The result list is ordered and
+     * the first result is a top suggestion.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + public Builder clearQuerySuggestions() { + if (querySuggestionsBuilder_ == null) { + querySuggestions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + querySuggestionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Results of the matched query suggestions. The result list is ordered and
+     * the first result is a top suggestion.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + public Builder removeQuerySuggestions(int index) { + if (querySuggestionsBuilder_ == null) { + ensureQuerySuggestionsIsMutable(); + querySuggestions_.remove(index); + onChanged(); + } else { + querySuggestionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Results of the matched query suggestions. The result list is ordered and
+     * the first result is a top suggestion.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.Builder + getQuerySuggestionsBuilder(int index) { + return getQuerySuggestionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Results of the matched query suggestions. The result list is ordered and
+     * the first result is a top suggestion.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestionOrBuilder + getQuerySuggestionsOrBuilder(int index) { + if (querySuggestionsBuilder_ == null) { + return querySuggestions_.get(index); + } else { + return querySuggestionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Results of the matched query suggestions. The result list is ordered and
+     * the first result is a top suggestion.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse + .QuerySuggestionOrBuilder> + getQuerySuggestionsOrBuilderList() { + if (querySuggestionsBuilder_ != null) { + return querySuggestionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(querySuggestions_); + } + } + /** + * + * + *
+     * Results of the matched query suggestions. The result list is ordered and
+     * the first result is a top suggestion.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.Builder + addQuerySuggestionsBuilder() { + return getQuerySuggestionsFieldBuilder() + .addBuilder( + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + .getDefaultInstance()); + } + /** + * + * + *
+     * Results of the matched query suggestions. The result list is ordered and
+     * the first result is a top suggestion.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.Builder + addQuerySuggestionsBuilder(int index) { + return getQuerySuggestionsFieldBuilder() + .addBuilder( + index, + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + .getDefaultInstance()); + } + /** + * + * + *
+     * Results of the matched query suggestions. The result list is ordered and
+     * the first result is a top suggestion.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.Builder> + getQuerySuggestionsBuilderList() { + return getQuerySuggestionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion, + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.Builder, + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestionOrBuilder> + getQuerySuggestionsFieldBuilder() { + if (querySuggestionsBuilder_ == null) { + querySuggestionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion, + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + .Builder, + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse + .QuerySuggestionOrBuilder>( + querySuggestions_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + querySuggestions_ = null; + } + return querySuggestionsBuilder_; + } + + private boolean tailMatchTriggered_; + /** + * + * + *
+     * True if the returned suggestions are all tail suggestions.
+     *
+     * For tail matching to be triggered, include_tail_suggestions in the request
+     * must be true and there must be no suggestions that match the full query.
+     * 
+ * + * bool tail_match_triggered = 2; + * + * @return The tailMatchTriggered. + */ + @java.lang.Override + public boolean getTailMatchTriggered() { + return tailMatchTriggered_; + } + /** + * + * + *
+     * True if the returned suggestions are all tail suggestions.
+     *
+     * For tail matching to be triggered, include_tail_suggestions in the request
+     * must be true and there must be no suggestions that match the full query.
+     * 
+ * + * bool tail_match_triggered = 2; + * + * @param value The tailMatchTriggered to set. + * @return This builder for chaining. + */ + public Builder setTailMatchTriggered(boolean value) { + + tailMatchTriggered_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * True if the returned suggestions are all tail suggestions.
+     *
+     * For tail matching to be triggered, include_tail_suggestions in the request
+     * must be true and there must be no suggestions that match the full query.
+     * 
+ * + * bool tail_match_triggered = 2; + * + * @return This builder for chaining. + */ + public Builder clearTailMatchTriggered() { + bitField0_ = (bitField0_ & ~0x00000002); + tailMatchTriggered_ = 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.discoveryengine.v1alpha.CompleteQueryResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.CompleteQueryResponse) + private static final com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompleteQueryResponseOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompleteQueryResponseOrBuilder.java new file mode 100644 index 000000000000..c0d6b2e12f5d --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompleteQueryResponseOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/completion_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface CompleteQueryResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.CompleteQueryResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Results of the matched query suggestions. The result list is ordered and
+   * the first result is a top suggestion.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + java.util.List + getQuerySuggestionsList(); + /** + * + * + *
+   * Results of the matched query suggestions. The result list is ordered and
+   * the first result is a top suggestion.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion + getQuerySuggestions(int index); + /** + * + * + *
+   * Results of the matched query suggestions. The result list is ordered and
+   * the first result is a top suggestion.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + int getQuerySuggestionsCount(); + /** + * + * + *
+   * Results of the matched query suggestions. The result list is ordered and
+   * the first result is a top suggestion.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse + .QuerySuggestionOrBuilder> + getQuerySuggestionsOrBuilderList(); + /** + * + * + *
+   * Results of the matched query suggestions. The result list is ordered and
+   * the first result is a top suggestion.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion query_suggestions = 1; + * + */ + com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestionOrBuilder + getQuerySuggestionsOrBuilder(int index); + + /** + * + * + *
+   * True if the returned suggestions are all tail suggestions.
+   *
+   * For tail matching to be triggered, include_tail_suggestions in the request
+   * must be true and there must be no suggestions that match the full query.
+   * 
+ * + * bool tail_match_triggered = 2; + * + * @return The tailMatchTriggered. + */ + boolean getTailMatchTriggered(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionInfo.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionInfo.java new file mode 100644 index 000000000000..b5e3f7bf648d --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionInfo.java @@ -0,0 +1,735 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/user_event.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Detailed completion information including completion attribution token and
+ * clicked completion info.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.CompletionInfo} + */ +public final class CompletionInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.CompletionInfo) + CompletionInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use CompletionInfo.newBuilder() to construct. + private CompletionInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CompletionInfo() { + selectedSuggestion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CompletionInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_CompletionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_CompletionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.CompletionInfo.class, + com.google.cloud.discoveryengine.v1alpha.CompletionInfo.Builder.class); + } + + public static final int SELECTED_SUGGESTION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object selectedSuggestion_ = ""; + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.suggestion].
+   * 
+ * + * string selected_suggestion = 1; + * + * @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.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.suggestion].
+   * 
+ * + * string selected_suggestion = 1; + * + * @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 = 2; + private int selectedPosition_ = 0; + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.suggestion]
+   * position, starting from 0.
+   * 
+ * + * int32 selected_position = 2; + * + * @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(selectedSuggestion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, selectedSuggestion_); + } + if (selectedPosition_ != 0) { + output.writeInt32(2, selectedPosition_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selectedSuggestion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, selectedSuggestion_); + } + if (selectedPosition_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, selectedPosition_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.CompletionInfo)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.CompletionInfo other = + (com.google.cloud.discoveryengine.v1alpha.CompletionInfo) obj; + + if (!getSelectedSuggestion().equals(other.getSelectedSuggestion())) return false; + if (getSelectedPosition() != other.getSelectedPosition()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SELECTED_SUGGESTION_FIELD_NUMBER; + hash = (53 * hash) + getSelectedSuggestion().hashCode(); + hash = (37 * hash) + SELECTED_POSITION_FIELD_NUMBER; + hash = (53 * hash) + getSelectedPosition(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.CompletionInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompletionInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompletionInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompletionInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompletionInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompletionInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompletionInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompletionInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompletionInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompletionInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompletionInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompletionInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.CompletionInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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.discoveryengine.v1alpha.CompletionInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.CompletionInfo) + com.google.cloud.discoveryengine.v1alpha.CompletionInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_CompletionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_CompletionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.CompletionInfo.class, + com.google.cloud.discoveryengine.v1alpha.CompletionInfo.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.CompletionInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + selectedSuggestion_ = ""; + selectedPosition_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_CompletionInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CompletionInfo getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.CompletionInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CompletionInfo build() { + com.google.cloud.discoveryengine.v1alpha.CompletionInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CompletionInfo buildPartial() { + com.google.cloud.discoveryengine.v1alpha.CompletionInfo result = + new com.google.cloud.discoveryengine.v1alpha.CompletionInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.CompletionInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.selectedSuggestion_ = selectedSuggestion_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.selectedPosition_ = selectedPosition_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.CompletionInfo) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.CompletionInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.CompletionInfo other) { + if (other == com.google.cloud.discoveryengine.v1alpha.CompletionInfo.getDefaultInstance()) + return this; + if (!other.getSelectedSuggestion().isEmpty()) { + selectedSuggestion_ = other.selectedSuggestion_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getSelectedPosition() != 0) { + setSelectedPosition(other.getSelectedPosition()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + selectedSuggestion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + selectedPosition_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object selectedSuggestion_ = ""; + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.suggestion].
+     * 
+ * + * string selected_suggestion = 1; + * + * @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.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.suggestion].
+     * 
+ * + * string selected_suggestion = 1; + * + * @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.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.suggestion].
+     * 
+ * + * string selected_suggestion = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.suggestion].
+     * 
+ * + * string selected_suggestion = 1; + * + * @return This builder for chaining. + */ + public Builder clearSelectedSuggestion() { + selectedSuggestion_ = getDefaultInstance().getSelectedSuggestion(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.suggestion].
+     * 
+ * + * string selected_suggestion = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int selectedPosition_; + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.suggestion]
+     * position, starting from 0.
+     * 
+ * + * int32 selected_position = 2; + * + * @return The selectedPosition. + */ + @java.lang.Override + public int getSelectedPosition() { + return selectedPosition_; + } + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.suggestion]
+     * position, starting from 0.
+     * 
+ * + * int32 selected_position = 2; + * + * @param value The selectedPosition to set. + * @return This builder for chaining. + */ + public Builder setSelectedPosition(int value) { + + selectedPosition_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * End user selected
+     * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.suggestion]
+     * position, starting from 0.
+     * 
+ * + * int32 selected_position = 2; + * + * @return This builder for chaining. + */ + public Builder clearSelectedPosition() { + bitField0_ = (bitField0_ & ~0x00000002); + 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.discoveryengine.v1alpha.CompletionInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.CompletionInfo) + private static final com.google.cloud.discoveryengine.v1alpha.CompletionInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.CompletionInfo(); + } + + public static com.google.cloud.discoveryengine.v1alpha.CompletionInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompletionInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CompletionInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionInfoOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionInfoOrBuilder.java new file mode 100644 index 000000000000..7bf60c924a9c --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionInfoOrBuilder.java @@ -0,0 +1,67 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/user_event.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface CompletionInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.CompletionInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.suggestion].
+   * 
+ * + * string selected_suggestion = 1; + * + * @return The selectedSuggestion. + */ + java.lang.String getSelectedSuggestion(); + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.suggestion].
+   * 
+ * + * string selected_suggestion = 1; + * + * @return The bytes for selectedSuggestion. + */ + com.google.protobuf.ByteString getSelectedSuggestionBytes(); + + /** + * + * + *
+   * End user selected
+   * [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.suggestion]
+   * position, starting from 0.
+   * 
+ * + * int32 selected_position = 2; + * + * @return The selectedPosition. + */ + int getSelectedPosition(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceProto.java new file mode 100644 index 000000000000..877da4ffe3c2 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CompletionServiceProto.java @@ -0,0 +1,138 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/completion_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +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_discoveryengine_v1alpha_CompleteQueryRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryResponse_QuerySuggestion_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryResponse_QuerySuggestion_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/discoveryengine/v1alpha/c" + + "ompletion_service.proto\022$google.cloud.di" + + "scoveryengine.v1alpha\032\034google/api/annota" + + "tions.proto\032\027google/api/client.proto\032\037go" + + "ogle/api/field_behavior.proto\032\031google/ap" + + "i/resource.proto\"\301\001\n\024CompleteQueryReques" + + "t\022E\n\ndata_store\030\001 \001(\tB1\342A\001\002\372A*\n(discover" + + "yengine.googleapis.com/DataStore\022\023\n\005quer" + + "y\030\002 \001(\tB\004\342A\001\002\022\023\n\013query_model\030\003 \001(\t\022\026\n\016us" + + "er_pseudo_id\030\004 \001(\t\022 \n\030include_tail_sugge" + + "stions\030\005 \001(\010\"\345\001\n\025CompleteQueryResponse\022f" + + "\n\021query_suggestions\030\001 \003(\0132K.google.cloud" + + ".discoveryengine.v1alpha.CompleteQueryRe" + + "sponse.QuerySuggestion\022\034\n\024tail_match_tri" + + "ggered\030\002 \001(\010\032F\n\017QuerySuggestion\022\022\n\nsugge" + + "stion\030\001 \001(\t\022\037\n\027completable_field_paths\030\002" + + " \003(\t2\236\003\n\021CompletionService\022\264\002\n\rCompleteQ" + + "uery\022:.google.cloud.discoveryengine.v1al" + + "pha.CompleteQueryRequest\032;.google.cloud." + + "discoveryengine.v1alpha.CompleteQueryRes" + + "ponse\"\251\001\202\323\344\223\002\242\001\022G/v1alpha/{data_store=pr" + + "ojects/*/locations/*/dataStores/*}:compl" + + "eteQueryZW\022U/v1alpha/{data_store=project" + + "s/*/locations/*/collections/*/dataStores" + + "/*}:completeQuery\032R\312A\036discoveryengine.go" + + "ogleapis.com\322A.https://www.googleapis.co" + + "m/auth/cloud-platformB\242\002\n(com.google.clo" + + "ud.discoveryengine.v1alphaB\026CompletionSe" + + "rviceProtoP\001ZRcloud.google.com/go/discov" + + "eryengine/apiv1alpha/discoveryenginepb;d" + + "iscoveryenginepb\242\002\017DISCOVERYENGINE\252\002$Goo" + + "gle.Cloud.DiscoveryEngine.V1Alpha\312\002$Goog" + + "le\\Cloud\\DiscoveryEngine\\V1alpha\352\002\'Googl" + + "e::Cloud::DiscoveryEngine::V1alphab\006prot" + + "o3" + }; + 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(), + }); + internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryRequest_descriptor, + new java.lang.String[] { + "DataStore", "Query", "QueryModel", "UserPseudoId", "IncludeTailSuggestions", + }); + internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryResponse_descriptor, + new java.lang.String[] { + "QuerySuggestions", "TailMatchTriggered", + }); + internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryResponse_QuerySuggestion_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryResponse_QuerySuggestion_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_CompleteQueryResponse_QuerySuggestion_descriptor, + new java.lang.String[] { + "Suggestion", "CompletableFieldPaths", + }); + 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(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/Conversation.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/Conversation.java new file mode 100644 index 000000000000..dde957842573 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/Conversation.java @@ -0,0 +1,2179 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversation.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * External conversation proto definition.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.Conversation} + */ +public final class Conversation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.Conversation) + ConversationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Conversation.newBuilder() to construct. + private Conversation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Conversation() { + name_ = ""; + state_ = 0; + userPseudoId_ = ""; + messages_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Conversation(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_Conversation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_Conversation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.Conversation.class, + com.google.cloud.discoveryengine.v1alpha.Conversation.Builder.class); + } + + /** + * + * + *
+   * Enumeration of the state of the conversation.
+   * 
+ * + * Protobuf enum {@code google.cloud.discoveryengine.v1alpha.Conversation.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Conversation is currently open.
+     * 
+ * + * IN_PROGRESS = 1; + */ + IN_PROGRESS(1), + /** + * + * + *
+     * Conversation has been completed.
+     * 
+ * + * COMPLETED = 2; + */ + COMPLETED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unknown.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Conversation is currently open.
+     * 
+ * + * IN_PROGRESS = 1; + */ + public static final int IN_PROGRESS_VALUE = 1; + /** + * + * + *
+     * Conversation has been completed.
+     * 
+ * + * COMPLETED = 2; + */ + public static final int COMPLETED_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 State 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 State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return IN_PROGRESS; + case 2: + return COMPLETED; + 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 State findValueByNumber(int number) { + return State.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.discoveryengine.v1alpha.Conversation.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final State[] VALUES = values(); + + public static State 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 State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.discoveryengine.v1alpha.Conversation.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Immutable. Fully qualified name
+   * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`
+   * 
+ * + * 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
+   * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`
+   * 
+ * + * 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 STATE_FIELD_NUMBER = 2; + private int state_ = 0; + /** + * + * + *
+   * The state of the Conversation.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation.State state = 2; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * The state of the Conversation.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation.State state = 2; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Conversation.State getState() { + com.google.cloud.discoveryengine.v1alpha.Conversation.State result = + com.google.cloud.discoveryengine.v1alpha.Conversation.State.forNumber(state_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.Conversation.State.UNRECOGNIZED + : result; + } + + public static final int USER_PSEUDO_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object userPseudoId_ = ""; + /** + * + * + *
+   * A unique identifier for tracking users.
+   * 
+ * + * string user_pseudo_id = 3; + * + * @return The userPseudoId. + */ + @java.lang.Override + public java.lang.String getUserPseudoId() { + java.lang.Object ref = userPseudoId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userPseudoId_ = s; + return s; + } + } + /** + * + * + *
+   * A unique identifier for tracking users.
+   * 
+ * + * string user_pseudo_id = 3; + * + * @return The bytes for userPseudoId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserPseudoIdBytes() { + java.lang.Object ref = userPseudoId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userPseudoId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGES_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List messages_; + /** + * + * + *
+   * Conversation messages.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + @java.lang.Override + public java.util.List + getMessagesList() { + return messages_; + } + /** + * + * + *
+   * Conversation messages.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.discoveryengine.v1alpha.ConversationMessageOrBuilder> + getMessagesOrBuilderList() { + return messages_; + } + /** + * + * + *
+   * Conversation messages.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + @java.lang.Override + public int getMessagesCount() { + return messages_.size(); + } + /** + * + * + *
+   * Conversation messages.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConversationMessage getMessages(int index) { + return messages_.get(index); + } + /** + * + * + *
+   * Conversation messages.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConversationMessageOrBuilder getMessagesOrBuilder( + int index) { + return messages_.get(index); + } + + public static final int START_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * Output only. The time the conversation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+   * Output only. The time the conversation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * Output only. The time the conversation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The time the conversation finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. The time the conversation finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The time the conversation finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (state_ + != com.google.cloud.discoveryengine.v1alpha.Conversation.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userPseudoId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, userPseudoId_); + } + for (int i = 0; i < messages_.size(); i++) { + output.writeMessage(4, messages_.get(i)); + } + if (startTime_ != null) { + output.writeMessage(5, getStartTime()); + } + if (endTime_ != null) { + output.writeMessage(6, getEndTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (state_ + != com.google.cloud.discoveryengine.v1alpha.Conversation.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userPseudoId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, userPseudoId_); + } + for (int i = 0; i < messages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, messages_.get(i)); + } + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getStartTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getEndTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.Conversation)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.Conversation other = + (com.google.cloud.discoveryengine.v1alpha.Conversation) obj; + + if (!getName().equals(other.getName())) return false; + if (state_ != other.state_) return false; + if (!getUserPseudoId().equals(other.getUserPseudoId())) return false; + if (!getMessagesList().equals(other.getMessagesList())) return false; + 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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + USER_PSEUDO_ID_FIELD_NUMBER; + hash = (53 * hash) + getUserPseudoId().hashCode(); + if (getMessagesCount() > 0) { + hash = (37 * hash) + MESSAGES_FIELD_NUMBER; + hash = (53 * hash) + getMessagesList().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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.Conversation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.Conversation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Conversation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.Conversation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Conversation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.Conversation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Conversation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.Conversation parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Conversation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.Conversation parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Conversation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.Conversation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.Conversation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * External conversation proto definition.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.Conversation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.Conversation) + com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_Conversation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_Conversation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.Conversation.class, + com.google.cloud.discoveryengine.v1alpha.Conversation.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.Conversation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + state_ = 0; + userPseudoId_ = ""; + if (messagesBuilder_ == null) { + messages_ = java.util.Collections.emptyList(); + } else { + messages_ = null; + messagesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_Conversation_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Conversation getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Conversation build() { + com.google.cloud.discoveryengine.v1alpha.Conversation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Conversation buildPartial() { + com.google.cloud.discoveryengine.v1alpha.Conversation result = + new com.google.cloud.discoveryengine.v1alpha.Conversation(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.Conversation result) { + if (messagesBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + messages_ = java.util.Collections.unmodifiableList(messages_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.messages_ = messages_; + } else { + result.messages_ = messagesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.Conversation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.userPseudoId_ = userPseudoId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.Conversation) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.Conversation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.Conversation other) { + if (other == com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getUserPseudoId().isEmpty()) { + userPseudoId_ = other.userPseudoId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (messagesBuilder_ == null) { + if (!other.messages_.isEmpty()) { + if (messages_.isEmpty()) { + messages_ = other.messages_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureMessagesIsMutable(); + messages_.addAll(other.messages_); + } + onChanged(); + } + } else { + if (!other.messages_.isEmpty()) { + if (messagesBuilder_.isEmpty()) { + messagesBuilder_.dispose(); + messagesBuilder_ = null; + messages_ = other.messages_; + bitField0_ = (bitField0_ & ~0x00000008); + messagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMessagesFieldBuilder() + : null; + } else { + messagesBuilder_.addAllMessages(other.messages_); + } + } + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + userPseudoId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + com.google.cloud.discoveryengine.v1alpha.ConversationMessage m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.ConversationMessage.parser(), + extensionRegistry); + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.add(m); + } else { + messagesBuilder_.addMessage(m); + } + break; + } // case 34 + case 42: + { + input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. Fully qualified name
+     * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`
+     * 
+ * + * 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
+     * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`
+     * 
+ * + * 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
+     * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`
+     * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Fully qualified name
+     * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Fully qualified name
+     * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`
+     * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * The state of the Conversation.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation.State state = 2; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * The state of the Conversation.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation.State state = 2; + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the Conversation.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation.State state = 2; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Conversation.State getState() { + com.google.cloud.discoveryengine.v1alpha.Conversation.State result = + com.google.cloud.discoveryengine.v1alpha.Conversation.State.forNumber(state_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.Conversation.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The state of the Conversation.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation.State state = 2; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.discoveryengine.v1alpha.Conversation.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the Conversation.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation.State state = 2; + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000002); + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object userPseudoId_ = ""; + /** + * + * + *
+     * A unique identifier for tracking users.
+     * 
+ * + * string user_pseudo_id = 3; + * + * @return The userPseudoId. + */ + public java.lang.String getUserPseudoId() { + java.lang.Object ref = userPseudoId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userPseudoId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A unique identifier for tracking users.
+     * 
+ * + * string user_pseudo_id = 3; + * + * @return The bytes for userPseudoId. + */ + public com.google.protobuf.ByteString getUserPseudoIdBytes() { + java.lang.Object ref = userPseudoId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userPseudoId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A unique identifier for tracking users.
+     * 
+ * + * string user_pseudo_id = 3; + * + * @param value The userPseudoId to set. + * @return This builder for chaining. + */ + public Builder setUserPseudoId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + userPseudoId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A unique identifier for tracking users.
+     * 
+ * + * string user_pseudo_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearUserPseudoId() { + userPseudoId_ = getDefaultInstance().getUserPseudoId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A unique identifier for tracking users.
+     * 
+ * + * string user_pseudo_id = 3; + * + * @param value The bytes for userPseudoId to set. + * @return This builder for chaining. + */ + public Builder setUserPseudoIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + userPseudoId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.util.List messages_ = + java.util.Collections.emptyList(); + + private void ensureMessagesIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + messages_ = + new java.util.ArrayList( + messages_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ConversationMessage, + com.google.cloud.discoveryengine.v1alpha.ConversationMessage.Builder, + com.google.cloud.discoveryengine.v1alpha.ConversationMessageOrBuilder> + messagesBuilder_; + + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + public java.util.List + getMessagesList() { + if (messagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(messages_); + } else { + return messagesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + public int getMessagesCount() { + if (messagesBuilder_ == null) { + return messages_.size(); + } else { + return messagesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + public com.google.cloud.discoveryengine.v1alpha.ConversationMessage getMessages(int index) { + if (messagesBuilder_ == null) { + return messages_.get(index); + } else { + return messagesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + public Builder setMessages( + int index, com.google.cloud.discoveryengine.v1alpha.ConversationMessage value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.set(index, value); + onChanged(); + } else { + messagesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + public Builder setMessages( + int index, + com.google.cloud.discoveryengine.v1alpha.ConversationMessage.Builder builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.set(index, builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + public Builder addMessages(com.google.cloud.discoveryengine.v1alpha.ConversationMessage value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.add(value); + onChanged(); + } else { + messagesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + public Builder addMessages( + int index, com.google.cloud.discoveryengine.v1alpha.ConversationMessage value) { + if (messagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMessagesIsMutable(); + messages_.add(index, value); + onChanged(); + } else { + messagesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + public Builder addMessages( + com.google.cloud.discoveryengine.v1alpha.ConversationMessage.Builder builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.add(builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + public Builder addMessages( + int index, + com.google.cloud.discoveryengine.v1alpha.ConversationMessage.Builder builderForValue) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.add(index, builderForValue.build()); + onChanged(); + } else { + messagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + public Builder addAllMessages( + java.lang.Iterable + values) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, messages_); + onChanged(); + } else { + messagesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + public Builder clearMessages() { + if (messagesBuilder_ == null) { + messages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + messagesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + public Builder removeMessages(int index) { + if (messagesBuilder_ == null) { + ensureMessagesIsMutable(); + messages_.remove(index); + onChanged(); + } else { + messagesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + public com.google.cloud.discoveryengine.v1alpha.ConversationMessage.Builder getMessagesBuilder( + int index) { + return getMessagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + public com.google.cloud.discoveryengine.v1alpha.ConversationMessageOrBuilder + getMessagesOrBuilder(int index) { + if (messagesBuilder_ == null) { + return messages_.get(index); + } else { + return messagesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + public java.util.List< + ? extends com.google.cloud.discoveryengine.v1alpha.ConversationMessageOrBuilder> + getMessagesOrBuilderList() { + if (messagesBuilder_ != null) { + return messagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(messages_); + } + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + public com.google.cloud.discoveryengine.v1alpha.ConversationMessage.Builder + addMessagesBuilder() { + return getMessagesFieldBuilder() + .addBuilder( + com.google.cloud.discoveryengine.v1alpha.ConversationMessage.getDefaultInstance()); + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + public com.google.cloud.discoveryengine.v1alpha.ConversationMessage.Builder addMessagesBuilder( + int index) { + return getMessagesFieldBuilder() + .addBuilder( + index, + com.google.cloud.discoveryengine.v1alpha.ConversationMessage.getDefaultInstance()); + } + /** + * + * + *
+     * Conversation messages.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + public java.util.List + getMessagesBuilderList() { + return getMessagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ConversationMessage, + com.google.cloud.discoveryengine.v1alpha.ConversationMessage.Builder, + com.google.cloud.discoveryengine.v1alpha.ConversationMessageOrBuilder> + getMessagesFieldBuilder() { + if (messagesBuilder_ == null) { + messagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ConversationMessage, + com.google.cloud.discoveryengine.v1alpha.ConversationMessage.Builder, + com.google.cloud.discoveryengine.v1alpha.ConversationMessageOrBuilder>( + messages_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + messages_ = null; + } + return messagesBuilder_; + } + + 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_; + /** + * + * + *
+     * Output only. The time the conversation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Output only. The time the conversation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Output only. The time the conversation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the conversation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the conversation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the conversation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000010); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the conversation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the conversation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * Output only. The time the conversation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + 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_; + /** + * + * + *
+     * Output only. The time the conversation finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. The time the conversation finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Output only. The time the conversation finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the conversation finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the conversation finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the conversation finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000020); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the conversation finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the conversation finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The time the conversation finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + 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.discoveryengine.v1alpha.Conversation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.Conversation) + private static final com.google.cloud.discoveryengine.v1alpha.Conversation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.Conversation(); + } + + public static com.google.cloud.discoveryengine.v1alpha.Conversation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Conversation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Conversation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationContext.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationContext.java new file mode 100644 index 000000000000..962a7674515d --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationContext.java @@ -0,0 +1,926 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversation.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Defines context of the conversation
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ConversationContext} + */ +public final class ConversationContext extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.ConversationContext) + ConversationContextOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConversationContext.newBuilder() to construct. + private ConversationContext(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConversationContext() { + contextDocuments_ = com.google.protobuf.LazyStringArrayList.emptyList(); + activeDocument_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConversationContext(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_ConversationContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_ConversationContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ConversationContext.class, + com.google.cloud.discoveryengine.v1alpha.ConversationContext.Builder.class); + } + + public static final int CONTEXT_DOCUMENTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList contextDocuments_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * The current list of documents the user is seeing.
+   * It contains the document resource references.
+   * 
+ * + * repeated string context_documents = 1; + * + * @return A list containing the contextDocuments. + */ + public com.google.protobuf.ProtocolStringList getContextDocumentsList() { + return contextDocuments_; + } + /** + * + * + *
+   * The current list of documents the user is seeing.
+   * It contains the document resource references.
+   * 
+ * + * repeated string context_documents = 1; + * + * @return The count of contextDocuments. + */ + public int getContextDocumentsCount() { + return contextDocuments_.size(); + } + /** + * + * + *
+   * The current list of documents the user is seeing.
+   * It contains the document resource references.
+   * 
+ * + * repeated string context_documents = 1; + * + * @param index The index of the element to return. + * @return The contextDocuments at the given index. + */ + public java.lang.String getContextDocuments(int index) { + return contextDocuments_.get(index); + } + /** + * + * + *
+   * The current list of documents the user is seeing.
+   * It contains the document resource references.
+   * 
+ * + * repeated string context_documents = 1; + * + * @param index The index of the value to return. + * @return The bytes of the contextDocuments at the given index. + */ + public com.google.protobuf.ByteString getContextDocumentsBytes(int index) { + return contextDocuments_.getByteString(index); + } + + public static final int ACTIVE_DOCUMENT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object activeDocument_ = ""; + /** + * + * + *
+   * The current active document the user opened.
+   * It contains the document resource reference.
+   * 
+ * + * string active_document = 2; + * + * @return The activeDocument. + */ + @java.lang.Override + public java.lang.String getActiveDocument() { + java.lang.Object ref = activeDocument_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + activeDocument_ = s; + return s; + } + } + /** + * + * + *
+   * The current active document the user opened.
+   * It contains the document resource reference.
+   * 
+ * + * string active_document = 2; + * + * @return The bytes for activeDocument. + */ + @java.lang.Override + public com.google.protobuf.ByteString getActiveDocumentBytes() { + java.lang.Object ref = activeDocument_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + activeDocument_ = 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 < contextDocuments_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, contextDocuments_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(activeDocument_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, activeDocument_); + } + getUnknownFields().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 < contextDocuments_.size(); i++) { + dataSize += computeStringSizeNoTag(contextDocuments_.getRaw(i)); + } + size += dataSize; + size += 1 * getContextDocumentsList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(activeDocument_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, activeDocument_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.ConversationContext)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.ConversationContext other = + (com.google.cloud.discoveryengine.v1alpha.ConversationContext) obj; + + if (!getContextDocumentsList().equals(other.getContextDocumentsList())) return false; + if (!getActiveDocument().equals(other.getActiveDocument())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getContextDocumentsCount() > 0) { + hash = (37 * hash) + CONTEXT_DOCUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getContextDocumentsList().hashCode(); + } + hash = (37 * hash) + ACTIVE_DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getActiveDocument().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationContext parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationContext parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.ConversationContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Defines context of the conversation
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ConversationContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.ConversationContext) + com.google.cloud.discoveryengine.v1alpha.ConversationContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_ConversationContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_ConversationContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ConversationContext.class, + com.google.cloud.discoveryengine.v1alpha.ConversationContext.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.ConversationContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + contextDocuments_ = com.google.protobuf.LazyStringArrayList.emptyList(); + activeDocument_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_ConversationContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConversationContext + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.ConversationContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConversationContext build() { + com.google.cloud.discoveryengine.v1alpha.ConversationContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConversationContext buildPartial() { + com.google.cloud.discoveryengine.v1alpha.ConversationContext result = + new com.google.cloud.discoveryengine.v1alpha.ConversationContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.ConversationContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + contextDocuments_.makeImmutable(); + result.contextDocuments_ = contextDocuments_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.activeDocument_ = activeDocument_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.ConversationContext) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.ConversationContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.ConversationContext other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.ConversationContext.getDefaultInstance()) + return this; + if (!other.contextDocuments_.isEmpty()) { + if (contextDocuments_.isEmpty()) { + contextDocuments_ = other.contextDocuments_; + bitField0_ |= 0x00000001; + } else { + ensureContextDocumentsIsMutable(); + contextDocuments_.addAll(other.contextDocuments_); + } + onChanged(); + } + if (!other.getActiveDocument().isEmpty()) { + activeDocument_ = other.activeDocument_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureContextDocumentsIsMutable(); + contextDocuments_.add(s); + break; + } // case 10 + case 18: + { + activeDocument_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList contextDocuments_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureContextDocumentsIsMutable() { + if (!contextDocuments_.isModifiable()) { + contextDocuments_ = new com.google.protobuf.LazyStringArrayList(contextDocuments_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+     * The current list of documents the user is seeing.
+     * It contains the document resource references.
+     * 
+ * + * repeated string context_documents = 1; + * + * @return A list containing the contextDocuments. + */ + public com.google.protobuf.ProtocolStringList getContextDocumentsList() { + contextDocuments_.makeImmutable(); + return contextDocuments_; + } + /** + * + * + *
+     * The current list of documents the user is seeing.
+     * It contains the document resource references.
+     * 
+ * + * repeated string context_documents = 1; + * + * @return The count of contextDocuments. + */ + public int getContextDocumentsCount() { + return contextDocuments_.size(); + } + /** + * + * + *
+     * The current list of documents the user is seeing.
+     * It contains the document resource references.
+     * 
+ * + * repeated string context_documents = 1; + * + * @param index The index of the element to return. + * @return The contextDocuments at the given index. + */ + public java.lang.String getContextDocuments(int index) { + return contextDocuments_.get(index); + } + /** + * + * + *
+     * The current list of documents the user is seeing.
+     * It contains the document resource references.
+     * 
+ * + * repeated string context_documents = 1; + * + * @param index The index of the value to return. + * @return The bytes of the contextDocuments at the given index. + */ + public com.google.protobuf.ByteString getContextDocumentsBytes(int index) { + return contextDocuments_.getByteString(index); + } + /** + * + * + *
+     * The current list of documents the user is seeing.
+     * It contains the document resource references.
+     * 
+ * + * repeated string context_documents = 1; + * + * @param index The index to set the value at. + * @param value The contextDocuments to set. + * @return This builder for chaining. + */ + public Builder setContextDocuments(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureContextDocumentsIsMutable(); + contextDocuments_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The current list of documents the user is seeing.
+     * It contains the document resource references.
+     * 
+ * + * repeated string context_documents = 1; + * + * @param value The contextDocuments to add. + * @return This builder for chaining. + */ + public Builder addContextDocuments(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureContextDocumentsIsMutable(); + contextDocuments_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The current list of documents the user is seeing.
+     * It contains the document resource references.
+     * 
+ * + * repeated string context_documents = 1; + * + * @param values The contextDocuments to add. + * @return This builder for chaining. + */ + public Builder addAllContextDocuments(java.lang.Iterable values) { + ensureContextDocumentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, contextDocuments_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The current list of documents the user is seeing.
+     * It contains the document resource references.
+     * 
+ * + * repeated string context_documents = 1; + * + * @return This builder for chaining. + */ + public Builder clearContextDocuments() { + contextDocuments_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * The current list of documents the user is seeing.
+     * It contains the document resource references.
+     * 
+ * + * repeated string context_documents = 1; + * + * @param value The bytes of the contextDocuments to add. + * @return This builder for chaining. + */ + public Builder addContextDocumentsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureContextDocumentsIsMutable(); + contextDocuments_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object activeDocument_ = ""; + /** + * + * + *
+     * The current active document the user opened.
+     * It contains the document resource reference.
+     * 
+ * + * string active_document = 2; + * + * @return The activeDocument. + */ + public java.lang.String getActiveDocument() { + java.lang.Object ref = activeDocument_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + activeDocument_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The current active document the user opened.
+     * It contains the document resource reference.
+     * 
+ * + * string active_document = 2; + * + * @return The bytes for activeDocument. + */ + public com.google.protobuf.ByteString getActiveDocumentBytes() { + java.lang.Object ref = activeDocument_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + activeDocument_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The current active document the user opened.
+     * It contains the document resource reference.
+     * 
+ * + * string active_document = 2; + * + * @param value The activeDocument to set. + * @return This builder for chaining. + */ + public Builder setActiveDocument(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + activeDocument_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The current active document the user opened.
+     * It contains the document resource reference.
+     * 
+ * + * string active_document = 2; + * + * @return This builder for chaining. + */ + public Builder clearActiveDocument() { + activeDocument_ = getDefaultInstance().getActiveDocument(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The current active document the user opened.
+     * It contains the document resource reference.
+     * 
+ * + * string active_document = 2; + * + * @param value The bytes for activeDocument to set. + * @return This builder for chaining. + */ + public Builder setActiveDocumentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + activeDocument_ = value; + bitField0_ |= 0x00000002; + 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.discoveryengine.v1alpha.ConversationContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.ConversationContext) + private static final com.google.cloud.discoveryengine.v1alpha.ConversationContext + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.ConversationContext(); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConversationContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConversationContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationContextOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationContextOrBuilder.java new file mode 100644 index 000000000000..2f652a9069ec --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationContextOrBuilder.java @@ -0,0 +1,107 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversation.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface ConversationContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.ConversationContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The current list of documents the user is seeing.
+   * It contains the document resource references.
+   * 
+ * + * repeated string context_documents = 1; + * + * @return A list containing the contextDocuments. + */ + java.util.List getContextDocumentsList(); + /** + * + * + *
+   * The current list of documents the user is seeing.
+   * It contains the document resource references.
+   * 
+ * + * repeated string context_documents = 1; + * + * @return The count of contextDocuments. + */ + int getContextDocumentsCount(); + /** + * + * + *
+   * The current list of documents the user is seeing.
+   * It contains the document resource references.
+   * 
+ * + * repeated string context_documents = 1; + * + * @param index The index of the element to return. + * @return The contextDocuments at the given index. + */ + java.lang.String getContextDocuments(int index); + /** + * + * + *
+   * The current list of documents the user is seeing.
+   * It contains the document resource references.
+   * 
+ * + * repeated string context_documents = 1; + * + * @param index The index of the value to return. + * @return The bytes of the contextDocuments at the given index. + */ + com.google.protobuf.ByteString getContextDocumentsBytes(int index); + + /** + * + * + *
+   * The current active document the user opened.
+   * It contains the document resource reference.
+   * 
+ * + * string active_document = 2; + * + * @return The activeDocument. + */ + java.lang.String getActiveDocument(); + /** + * + * + *
+   * The current active document the user opened.
+   * It contains the document resource reference.
+   * 
+ * + * string active_document = 2; + * + * @return The bytes for activeDocument. + */ + com.google.protobuf.ByteString getActiveDocumentBytes(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationMessage.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationMessage.java new file mode 100644 index 000000000000..68d43c57fe5e --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationMessage.java @@ -0,0 +1,1399 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversation.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Defines a conversation message.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ConversationMessage} + */ +public final class ConversationMessage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.ConversationMessage) + ConversationMessageOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConversationMessage.newBuilder() to construct. + private ConversationMessage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConversationMessage() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConversationMessage(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_ConversationMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_ConversationMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ConversationMessage.class, + com.google.cloud.discoveryengine.v1alpha.ConversationMessage.Builder.class); + } + + private int messageCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object message_; + + public enum MessageCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + USER_INPUT(1), + REPLY(2), + MESSAGE_NOT_SET(0); + private final int value; + + private MessageCase(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 MessageCase valueOf(int value) { + return forNumber(value); + } + + public static MessageCase forNumber(int value) { + switch (value) { + case 1: + return USER_INPUT; + case 2: + return REPLY; + case 0: + return MESSAGE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public MessageCase getMessageCase() { + return MessageCase.forNumber(messageCase_); + } + + public static final int USER_INPUT_FIELD_NUMBER = 1; + /** + * + * + *
+   * User text input.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.TextInput user_input = 1; + * + * @return Whether the userInput field is set. + */ + @java.lang.Override + public boolean hasUserInput() { + return messageCase_ == 1; + } + /** + * + * + *
+   * User text input.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.TextInput user_input = 1; + * + * @return The userInput. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.TextInput getUserInput() { + if (messageCase_ == 1) { + return (com.google.cloud.discoveryengine.v1alpha.TextInput) message_; + } + return com.google.cloud.discoveryengine.v1alpha.TextInput.getDefaultInstance(); + } + /** + * + * + *
+   * User text input.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.TextInput user_input = 1; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.TextInputOrBuilder getUserInputOrBuilder() { + if (messageCase_ == 1) { + return (com.google.cloud.discoveryengine.v1alpha.TextInput) message_; + } + return com.google.cloud.discoveryengine.v1alpha.TextInput.getDefaultInstance(); + } + + public static final int REPLY_FIELD_NUMBER = 2; + /** + * + * + *
+   * Search reply.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 2; + * + * @return Whether the reply field is set. + */ + @java.lang.Override + public boolean hasReply() { + return messageCase_ == 2; + } + /** + * + * + *
+   * Search reply.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 2; + * + * @return The reply. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Reply getReply() { + if (messageCase_ == 2) { + return (com.google.cloud.discoveryengine.v1alpha.Reply) message_; + } + return com.google.cloud.discoveryengine.v1alpha.Reply.getDefaultInstance(); + } + /** + * + * + *
+   * Search reply.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 2; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ReplyOrBuilder getReplyOrBuilder() { + if (messageCase_ == 2) { + return (com.google.cloud.discoveryengine.v1alpha.Reply) message_; + } + return com.google.cloud.discoveryengine.v1alpha.Reply.getDefaultInstance(); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Message creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Message creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Message creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (messageCase_ == 1) { + output.writeMessage(1, (com.google.cloud.discoveryengine.v1alpha.TextInput) message_); + } + if (messageCase_ == 2) { + output.writeMessage(2, (com.google.cloud.discoveryengine.v1alpha.Reply) message_); + } + if (createTime_ != null) { + output.writeMessage(3, getCreateTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (messageCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.discoveryengine.v1alpha.TextInput) message_); + } + if (messageCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.discoveryengine.v1alpha.Reply) message_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.ConversationMessage)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.ConversationMessage other = + (com.google.cloud.discoveryengine.v1alpha.ConversationMessage) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!getMessageCase().equals(other.getMessageCase())) return false; + switch (messageCase_) { + case 1: + if (!getUserInput().equals(other.getUserInput())) return false; + break; + case 2: + if (!getReply().equals(other.getReply())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + switch (messageCase_) { + case 1: + hash = (37 * hash) + USER_INPUT_FIELD_NUMBER; + hash = (53 * hash) + getUserInput().hashCode(); + break; + case 2: + hash = (37 * hash) + REPLY_FIELD_NUMBER; + hash = (53 * hash) + getReply().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationMessage parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationMessage parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationMessage parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationMessage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationMessage parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationMessage parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationMessage parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationMessage parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationMessage parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationMessage parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationMessage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.ConversationMessage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Defines a conversation message.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ConversationMessage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.ConversationMessage) + com.google.cloud.discoveryengine.v1alpha.ConversationMessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_ConversationMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_ConversationMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ConversationMessage.class, + com.google.cloud.discoveryengine.v1alpha.ConversationMessage.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.ConversationMessage.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (userInputBuilder_ != null) { + userInputBuilder_.clear(); + } + if (replyBuilder_ != null) { + replyBuilder_.clear(); + } + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + messageCase_ = 0; + message_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_ConversationMessage_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConversationMessage + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.ConversationMessage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConversationMessage build() { + com.google.cloud.discoveryengine.v1alpha.ConversationMessage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConversationMessage buildPartial() { + com.google.cloud.discoveryengine.v1alpha.ConversationMessage result = + new com.google.cloud.discoveryengine.v1alpha.ConversationMessage(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.ConversationMessage result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + } + + private void buildPartialOneofs( + com.google.cloud.discoveryengine.v1alpha.ConversationMessage result) { + result.messageCase_ = messageCase_; + result.message_ = this.message_; + if (messageCase_ == 1 && userInputBuilder_ != null) { + result.message_ = userInputBuilder_.build(); + } + if (messageCase_ == 2 && replyBuilder_ != null) { + result.message_ = replyBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.ConversationMessage) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.ConversationMessage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.ConversationMessage other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.ConversationMessage.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + switch (other.getMessageCase()) { + case USER_INPUT: + { + mergeUserInput(other.getUserInput()); + break; + } + case REPLY: + { + mergeReply(other.getReply()); + break; + } + case MESSAGE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getUserInputFieldBuilder().getBuilder(), extensionRegistry); + messageCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(getReplyFieldBuilder().getBuilder(), extensionRegistry); + messageCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int messageCase_ = 0; + private java.lang.Object message_; + + public MessageCase getMessageCase() { + return MessageCase.forNumber(messageCase_); + } + + public Builder clearMessage() { + messageCase_ = 0; + message_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.TextInput, + com.google.cloud.discoveryengine.v1alpha.TextInput.Builder, + com.google.cloud.discoveryengine.v1alpha.TextInputOrBuilder> + userInputBuilder_; + /** + * + * + *
+     * User text input.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.TextInput user_input = 1; + * + * @return Whether the userInput field is set. + */ + @java.lang.Override + public boolean hasUserInput() { + return messageCase_ == 1; + } + /** + * + * + *
+     * User text input.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.TextInput user_input = 1; + * + * @return The userInput. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.TextInput getUserInput() { + if (userInputBuilder_ == null) { + if (messageCase_ == 1) { + return (com.google.cloud.discoveryengine.v1alpha.TextInput) message_; + } + return com.google.cloud.discoveryengine.v1alpha.TextInput.getDefaultInstance(); + } else { + if (messageCase_ == 1) { + return userInputBuilder_.getMessage(); + } + return com.google.cloud.discoveryengine.v1alpha.TextInput.getDefaultInstance(); + } + } + /** + * + * + *
+     * User text input.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.TextInput user_input = 1; + */ + public Builder setUserInput(com.google.cloud.discoveryengine.v1alpha.TextInput value) { + if (userInputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + userInputBuilder_.setMessage(value); + } + messageCase_ = 1; + return this; + } + /** + * + * + *
+     * User text input.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.TextInput user_input = 1; + */ + public Builder setUserInput( + com.google.cloud.discoveryengine.v1alpha.TextInput.Builder builderForValue) { + if (userInputBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + userInputBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 1; + return this; + } + /** + * + * + *
+     * User text input.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.TextInput user_input = 1; + */ + public Builder mergeUserInput(com.google.cloud.discoveryengine.v1alpha.TextInput value) { + if (userInputBuilder_ == null) { + if (messageCase_ == 1 + && message_ + != com.google.cloud.discoveryengine.v1alpha.TextInput.getDefaultInstance()) { + message_ = + com.google.cloud.discoveryengine.v1alpha.TextInput.newBuilder( + (com.google.cloud.discoveryengine.v1alpha.TextInput) message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 1) { + userInputBuilder_.mergeFrom(value); + } else { + userInputBuilder_.setMessage(value); + } + } + messageCase_ = 1; + return this; + } + /** + * + * + *
+     * User text input.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.TextInput user_input = 1; + */ + public Builder clearUserInput() { + if (userInputBuilder_ == null) { + if (messageCase_ == 1) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 1) { + messageCase_ = 0; + message_ = null; + } + userInputBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * User text input.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.TextInput user_input = 1; + */ + public com.google.cloud.discoveryengine.v1alpha.TextInput.Builder getUserInputBuilder() { + return getUserInputFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * User text input.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.TextInput user_input = 1; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.TextInputOrBuilder getUserInputOrBuilder() { + if ((messageCase_ == 1) && (userInputBuilder_ != null)) { + return userInputBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 1) { + return (com.google.cloud.discoveryengine.v1alpha.TextInput) message_; + } + return com.google.cloud.discoveryengine.v1alpha.TextInput.getDefaultInstance(); + } + } + /** + * + * + *
+     * User text input.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.TextInput user_input = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.TextInput, + com.google.cloud.discoveryengine.v1alpha.TextInput.Builder, + com.google.cloud.discoveryengine.v1alpha.TextInputOrBuilder> + getUserInputFieldBuilder() { + if (userInputBuilder_ == null) { + if (!(messageCase_ == 1)) { + message_ = com.google.cloud.discoveryengine.v1alpha.TextInput.getDefaultInstance(); + } + userInputBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.TextInput, + com.google.cloud.discoveryengine.v1alpha.TextInput.Builder, + com.google.cloud.discoveryengine.v1alpha.TextInputOrBuilder>( + (com.google.cloud.discoveryengine.v1alpha.TextInput) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 1; + onChanged(); + return userInputBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Reply, + com.google.cloud.discoveryengine.v1alpha.Reply.Builder, + com.google.cloud.discoveryengine.v1alpha.ReplyOrBuilder> + replyBuilder_; + /** + * + * + *
+     * Search reply.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 2; + * + * @return Whether the reply field is set. + */ + @java.lang.Override + public boolean hasReply() { + return messageCase_ == 2; + } + /** + * + * + *
+     * Search reply.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 2; + * + * @return The reply. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Reply getReply() { + if (replyBuilder_ == null) { + if (messageCase_ == 2) { + return (com.google.cloud.discoveryengine.v1alpha.Reply) message_; + } + return com.google.cloud.discoveryengine.v1alpha.Reply.getDefaultInstance(); + } else { + if (messageCase_ == 2) { + return replyBuilder_.getMessage(); + } + return com.google.cloud.discoveryengine.v1alpha.Reply.getDefaultInstance(); + } + } + /** + * + * + *
+     * Search reply.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 2; + */ + public Builder setReply(com.google.cloud.discoveryengine.v1alpha.Reply value) { + if (replyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + replyBuilder_.setMessage(value); + } + messageCase_ = 2; + return this; + } + /** + * + * + *
+     * Search reply.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 2; + */ + public Builder setReply( + com.google.cloud.discoveryengine.v1alpha.Reply.Builder builderForValue) { + if (replyBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + replyBuilder_.setMessage(builderForValue.build()); + } + messageCase_ = 2; + return this; + } + /** + * + * + *
+     * Search reply.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 2; + */ + public Builder mergeReply(com.google.cloud.discoveryengine.v1alpha.Reply value) { + if (replyBuilder_ == null) { + if (messageCase_ == 2 + && message_ != com.google.cloud.discoveryengine.v1alpha.Reply.getDefaultInstance()) { + message_ = + com.google.cloud.discoveryengine.v1alpha.Reply.newBuilder( + (com.google.cloud.discoveryengine.v1alpha.Reply) message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + if (messageCase_ == 2) { + replyBuilder_.mergeFrom(value); + } else { + replyBuilder_.setMessage(value); + } + } + messageCase_ = 2; + return this; + } + /** + * + * + *
+     * Search reply.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 2; + */ + public Builder clearReply() { + if (replyBuilder_ == null) { + if (messageCase_ == 2) { + messageCase_ = 0; + message_ = null; + onChanged(); + } + } else { + if (messageCase_ == 2) { + messageCase_ = 0; + message_ = null; + } + replyBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Search reply.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.Reply.Builder getReplyBuilder() { + return getReplyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Search reply.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 2; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ReplyOrBuilder getReplyOrBuilder() { + if ((messageCase_ == 2) && (replyBuilder_ != null)) { + return replyBuilder_.getMessageOrBuilder(); + } else { + if (messageCase_ == 2) { + return (com.google.cloud.discoveryengine.v1alpha.Reply) message_; + } + return com.google.cloud.discoveryengine.v1alpha.Reply.getDefaultInstance(); + } + } + /** + * + * + *
+     * Search reply.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Reply, + com.google.cloud.discoveryengine.v1alpha.Reply.Builder, + com.google.cloud.discoveryengine.v1alpha.ReplyOrBuilder> + getReplyFieldBuilder() { + if (replyBuilder_ == null) { + if (!(messageCase_ == 2)) { + message_ = com.google.cloud.discoveryengine.v1alpha.Reply.getDefaultInstance(); + } + replyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Reply, + com.google.cloud.discoveryengine.v1alpha.Reply.Builder, + com.google.cloud.discoveryengine.v1alpha.ReplyOrBuilder>( + (com.google.cloud.discoveryengine.v1alpha.Reply) message_, + getParentForChildren(), + isClean()); + message_ = null; + } + messageCase_ = 2; + onChanged(); + return replyBuilder_; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Message creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Message creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Message creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Message creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Message creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Message creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Message creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Message creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Message creation timestamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.ConversationMessage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.ConversationMessage) + private static final com.google.cloud.discoveryengine.v1alpha.ConversationMessage + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.ConversationMessage(); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConversationMessage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConversationMessage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConversationMessage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationMessageOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationMessageOrBuilder.java new file mode 100644 index 000000000000..d60e50d3b185 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationMessageOrBuilder.java @@ -0,0 +1,135 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversation.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface ConversationMessageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.ConversationMessage) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * User text input.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.TextInput user_input = 1; + * + * @return Whether the userInput field is set. + */ + boolean hasUserInput(); + /** + * + * + *
+   * User text input.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.TextInput user_input = 1; + * + * @return The userInput. + */ + com.google.cloud.discoveryengine.v1alpha.TextInput getUserInput(); + /** + * + * + *
+   * User text input.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.TextInput user_input = 1; + */ + com.google.cloud.discoveryengine.v1alpha.TextInputOrBuilder getUserInputOrBuilder(); + + /** + * + * + *
+   * Search reply.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 2; + * + * @return Whether the reply field is set. + */ + boolean hasReply(); + /** + * + * + *
+   * Search reply.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 2; + * + * @return The reply. + */ + com.google.cloud.discoveryengine.v1alpha.Reply getReply(); + /** + * + * + *
+   * Search reply.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 2; + */ + com.google.cloud.discoveryengine.v1alpha.ReplyOrBuilder getReplyOrBuilder(); + + /** + * + * + *
+   * Output only. Message creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Message creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Message creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + com.google.cloud.discoveryengine.v1alpha.ConversationMessage.MessageCase getMessageCase(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationName.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationName.java new file mode 100644 index 000000000000..1d0cdd295228 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationName.java @@ -0,0 +1,432 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +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 ConversationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_DATA_STORE_CONVERSATION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}"); + private static final PathTemplate PROJECT_LOCATION_COLLECTION_DATA_STORE_CONVERSATION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/conversations/{conversation}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String dataStore; + private final String conversation; + private final String collection; + + @Deprecated + protected ConversationName() { + project = null; + location = null; + dataStore = null; + conversation = null; + collection = null; + } + + private ConversationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + dataStore = Preconditions.checkNotNull(builder.getDataStore()); + conversation = Preconditions.checkNotNull(builder.getConversation()); + collection = null; + pathTemplate = PROJECT_LOCATION_DATA_STORE_CONVERSATION; + } + + private ConversationName(ProjectLocationCollectionDataStoreConversationBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + collection = Preconditions.checkNotNull(builder.getCollection()); + dataStore = Preconditions.checkNotNull(builder.getDataStore()); + conversation = Preconditions.checkNotNull(builder.getConversation()); + pathTemplate = PROJECT_LOCATION_COLLECTION_DATA_STORE_CONVERSATION; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataStore() { + return dataStore; + } + + public String getConversation() { + return conversation; + } + + public String getCollection() { + return collection; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectLocationDataStoreConversationBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static ProjectLocationCollectionDataStoreConversationBuilder + newProjectLocationCollectionDataStoreConversationBuilder() { + return new ProjectLocationCollectionDataStoreConversationBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ConversationName of( + String project, String location, String dataStore, String conversation) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setConversation(conversation) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static ConversationName ofProjectLocationDataStoreConversationName( + String project, String location, String dataStore, String conversation) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setConversation(conversation) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static ConversationName ofProjectLocationCollectionDataStoreConversationName( + String project, String location, String collection, String dataStore, String conversation) { + return newProjectLocationCollectionDataStoreConversationBuilder() + .setProject(project) + .setLocation(location) + .setCollection(collection) + .setDataStore(dataStore) + .setConversation(conversation) + .build(); + } + + public static String format( + String project, String location, String dataStore, String conversation) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setConversation(conversation) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationDataStoreConversationName( + String project, String location, String dataStore, String conversation) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setConversation(conversation) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationCollectionDataStoreConversationName( + String project, String location, String collection, String dataStore, String conversation) { + return newProjectLocationCollectionDataStoreConversationBuilder() + .setProject(project) + .setLocation(location) + .setCollection(collection) + .setDataStore(dataStore) + .setConversation(conversation) + .build() + .toString(); + } + + public static ConversationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_DATA_STORE_CONVERSATION.matches(formattedString)) { + Map matchMap = + PROJECT_LOCATION_DATA_STORE_CONVERSATION.match(formattedString); + return ofProjectLocationDataStoreConversationName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("data_store"), + matchMap.get("conversation")); + } else if (PROJECT_LOCATION_COLLECTION_DATA_STORE_CONVERSATION.matches(formattedString)) { + Map matchMap = + PROJECT_LOCATION_COLLECTION_DATA_STORE_CONVERSATION.match(formattedString); + return ofProjectLocationCollectionDataStoreConversationName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("collection"), + matchMap.get("data_store"), + matchMap.get("conversation")); + } + throw new ValidationException("ConversationName.parse: formattedString not in valid format"); + } + + 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 (ConversationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_DATA_STORE_CONVERSATION.matches(formattedString) + || PROJECT_LOCATION_COLLECTION_DATA_STORE_CONVERSATION.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 (dataStore != null) { + fieldMapBuilder.put("data_store", dataStore); + } + if (conversation != null) { + fieldMapBuilder.put("conversation", conversation); + } + if (collection != null) { + fieldMapBuilder.put("collection", collection); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + ConversationName that = ((ConversationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.dataStore, that.dataStore) + && Objects.equals(this.conversation, that.conversation) + && Objects.equals(this.collection, that.collection); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(dataStore); + h *= 1000003; + h ^= Objects.hashCode(conversation); + h *= 1000003; + h ^= Objects.hashCode(collection); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}. + */ + public static class Builder { + private String project; + private String location; + private String dataStore; + private String conversation; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataStore() { + return dataStore; + } + + public String getConversation() { + return conversation; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setDataStore(String dataStore) { + this.dataStore = dataStore; + return this; + } + + public Builder setConversation(String conversation) { + this.conversation = conversation; + return this; + } + + private Builder(ConversationName conversationName) { + Preconditions.checkArgument( + Objects.equals(conversationName.pathTemplate, PROJECT_LOCATION_DATA_STORE_CONVERSATION), + "toBuilder is only supported when ConversationName has the pattern of projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}"); + this.project = conversationName.project; + this.location = conversationName.location; + this.dataStore = conversationName.dataStore; + this.conversation = conversationName.conversation; + } + + public ConversationName build() { + return new ConversationName(this); + } + } + + /** + * Builder for + * projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/conversations/{conversation}. + */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class ProjectLocationCollectionDataStoreConversationBuilder { + private String project; + private String location; + private String collection; + private String dataStore; + private String conversation; + + protected ProjectLocationCollectionDataStoreConversationBuilder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCollection() { + return collection; + } + + public String getDataStore() { + return dataStore; + } + + public String getConversation() { + return conversation; + } + + public ProjectLocationCollectionDataStoreConversationBuilder setProject(String project) { + this.project = project; + return this; + } + + public ProjectLocationCollectionDataStoreConversationBuilder setLocation(String location) { + this.location = location; + return this; + } + + public ProjectLocationCollectionDataStoreConversationBuilder setCollection(String collection) { + this.collection = collection; + return this; + } + + public ProjectLocationCollectionDataStoreConversationBuilder setDataStore(String dataStore) { + this.dataStore = dataStore; + return this; + } + + public ProjectLocationCollectionDataStoreConversationBuilder setConversation( + String conversation) { + this.conversation = conversation; + return this; + } + + public ConversationName build() { + return new ConversationName(this); + } + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationOrBuilder.java new file mode 100644 index 000000000000..524622f3e4ed --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationOrBuilder.java @@ -0,0 +1,231 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversation.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface ConversationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.Conversation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. Fully qualified name
+   * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. Fully qualified name
+   * `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The state of the Conversation.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation.State state = 2; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * The state of the Conversation.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation.State state = 2; + * + * @return The state. + */ + com.google.cloud.discoveryengine.v1alpha.Conversation.State getState(); + + /** + * + * + *
+   * A unique identifier for tracking users.
+   * 
+ * + * string user_pseudo_id = 3; + * + * @return The userPseudoId. + */ + java.lang.String getUserPseudoId(); + /** + * + * + *
+   * A unique identifier for tracking users.
+   * 
+ * + * string user_pseudo_id = 3; + * + * @return The bytes for userPseudoId. + */ + com.google.protobuf.ByteString getUserPseudoIdBytes(); + + /** + * + * + *
+   * Conversation messages.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + java.util.List getMessagesList(); + /** + * + * + *
+   * Conversation messages.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + com.google.cloud.discoveryengine.v1alpha.ConversationMessage getMessages(int index); + /** + * + * + *
+   * Conversation messages.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + int getMessagesCount(); + /** + * + * + *
+   * Conversation messages.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + java.util.List + getMessagesOrBuilderList(); + /** + * + * + *
+   * Conversation messages.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.ConversationMessage messages = 4; + */ + com.google.cloud.discoveryengine.v1alpha.ConversationMessageOrBuilder getMessagesOrBuilder( + int index); + + /** + * + * + *
+   * Output only. The time the conversation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+   * Output only. The time the conversation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * Output only. The time the conversation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the conversation finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The time the conversation finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The time the conversation finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationProto.java new file mode 100644 index 000000000000..5ca3b96d47eb --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationProto.java @@ -0,0 +1,183 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversation.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public final class ConversationProto { + private ConversationProto() {} + + 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_discoveryengine_v1alpha_Conversation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_Conversation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_Reply_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_Reply_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_Reply_Reference_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_Reply_Reference_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_ConversationContext_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_ConversationContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_TextInput_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_TextInput_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_ConversationMessage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_ConversationMessage_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/discoveryengine/v1alpha/c" + + "onversation.proto\022$google.cloud.discover" + + "yengine.v1alpha\032\037google/api/field_behavi" + + "or.proto\032\031google/api/resource.proto\0329goo" + + "gle/cloud/discoveryengine/v1alpha/search" + + "_service.proto\032\037google/protobuf/timestam" + + "p.proto\"\203\005\n\014Conversation\022\022\n\004name\030\001 \001(\tB\004" + + "\342A\001\005\022G\n\005state\030\002 \001(\01628.google.cloud.disco" + + "veryengine.v1alpha.Conversation.State\022\026\n" + + "\016user_pseudo_id\030\003 \001(\t\022K\n\010messages\030\004 \003(\0132" + + "9.google.cloud.discoveryengine.v1alpha.C" + + "onversationMessage\0224\n\nstart_time\030\005 \001(\0132\032" + + ".google.protobuf.TimestampB\004\342A\001\003\0222\n\010end_" + + "time\030\006 \001(\0132\032.google.protobuf.TimestampB\004" + + "\342A\001\003\">\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\017\n\013" + + "IN_PROGRESS\020\001\022\r\n\tCOMPLETED\020\002:\206\002\352A\202\002\n+dis" + + "coveryengine.googleapis.com/Conversation" + + "\022\\projects/{project}/locations/{location" + + "}/dataStores/{data_store}/conversations/" + + "{conversation}\022uprojects/{project}/locat" + + "ions/{location}/collections/{collection}" + + "/dataStores/{data_store}/conversations/{" + + "conversation}\"\207\002\n\005Reply\022\021\n\005reply\030\001 \001(\tB\002" + + "\030\001\022M\n\nreferences\030\002 \003(\01325.google.cloud.di" + + "scoveryengine.v1alpha.Reply.ReferenceB\002\030" + + "\001\022M\n\007summary\030\003 \001(\0132<.google.cloud.discov" + + "eryengine.v1alpha.SearchResponse.Summary" + + "\032M\n\tReference\022\013\n\003uri\030\001 \001(\t\022\023\n\013anchor_tex" + + "t\030\002 \001(\t\022\r\n\005start\030\003 \001(\005\022\013\n\003end\030\004 \001(\005:\002\030\001\"" + + "I\n\023ConversationContext\022\031\n\021context_docume" + + "nts\030\001 \003(\t\022\027\n\017active_document\030\002 \001(\t\"f\n\tTe" + + "xtInput\022\r\n\005input\030\001 \001(\t\022J\n\007context\030\002 \001(\0132" + + "9.google.cloud.discoveryengine.v1alpha.C" + + "onversationContext\"\334\001\n\023ConversationMessa" + + "ge\022E\n\nuser_input\030\001 \001(\0132/.google.cloud.di" + + "scoveryengine.v1alpha.TextInputH\000\022<\n\005rep" + + "ly\030\002 \001(\0132+.google.cloud.discoveryengine." + + "v1alpha.ReplyH\000\0225\n\013create_time\030\003 \001(\0132\032.g" + + "oogle.protobuf.TimestampB\004\342A\001\003B\t\n\007messag" + + "eB\235\002\n(com.google.cloud.discoveryengine.v" + + "1alphaB\021ConversationProtoP\001ZRcloud.googl" + + "e.com/go/discoveryengine/apiv1alpha/disc" + + "overyenginepb;discoveryenginepb\242\002\017DISCOV" + + "ERYENGINE\252\002$Google.Cloud.DiscoveryEngine" + + ".V1Alpha\312\002$Google\\Cloud\\DiscoveryEngine\\" + + "V1alpha\352\002\'Google::Cloud::DiscoveryEngine" + + "::V1alphab\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.discoveryengine.v1alpha.SearchServiceProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_discoveryengine_v1alpha_Conversation_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_discoveryengine_v1alpha_Conversation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_Conversation_descriptor, + new java.lang.String[] { + "Name", "State", "UserPseudoId", "Messages", "StartTime", "EndTime", + }); + internal_static_google_cloud_discoveryengine_v1alpha_Reply_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_discoveryengine_v1alpha_Reply_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_Reply_descriptor, + new java.lang.String[] { + "Reply", "References", "Summary", + }); + internal_static_google_cloud_discoveryengine_v1alpha_Reply_Reference_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_Reply_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1alpha_Reply_Reference_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_Reply_Reference_descriptor, + new java.lang.String[] { + "Uri", "AnchorText", "Start", "End", + }); + internal_static_google_cloud_discoveryengine_v1alpha_ConversationContext_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_discoveryengine_v1alpha_ConversationContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_ConversationContext_descriptor, + new java.lang.String[] { + "ContextDocuments", "ActiveDocument", + }); + internal_static_google_cloud_discoveryengine_v1alpha_TextInput_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_discoveryengine_v1alpha_TextInput_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_TextInput_descriptor, + new java.lang.String[] { + "Input", "Context", + }); + internal_static_google_cloud_discoveryengine_v1alpha_ConversationMessage_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_discoveryengine_v1alpha_ConversationMessage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_ConversationMessage_descriptor, + new java.lang.String[] { + "UserInput", "Reply", "CreateTime", "Message", + }); + 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.discoveryengine.v1alpha.SearchServiceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceProto.java new file mode 100644 index 000000000000..294108e05f6b --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConversationalSearchServiceProto.java @@ -0,0 +1,304 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public final class ConversationalSearchServiceProto { + private ConversationalSearchServiceProto() {} + + 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_discoveryengine_v1alpha_ConverseConversationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationRequest_UserLabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationRequest_UserLabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_CreateConversationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_CreateConversationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_UpdateConversationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_UpdateConversationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_DeleteConversationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_DeleteConversationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_GetConversationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_GetConversationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_ListConversationsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_ListConversationsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_ListConversationsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_ListConversationsResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nHgoogle/cloud/discoveryengine/v1alpha/c" + + "onversational_search_service.proto\022$goog" + + "le.cloud.discoveryengine.v1alpha\032\034google" + + "/api/annotations.proto\032\027google/api/clien" + + "t.proto\032\037google/api/field_behavior.proto" + + "\032\031google/api/resource.proto\0327google/clou" + + "d/discoveryengine/v1alpha/conversation.p" + + "roto\0329google/cloud/discoveryengine/v1alp" + + "ha/search_service.proto\032\033google/protobuf" + + "/empty.proto\032 google/protobuf/field_mask" + + ".proto\"\325\004\n\033ConverseConversationRequest\022B" + + "\n\004name\030\001 \001(\tB4\342A\001\002\372A-\n+discoveryengine.g" + + "oogleapis.com/Conversation\022D\n\005query\030\002 \001(" + + "\0132/.google.cloud.discoveryengine.v1alpha" + + ".TextInputB\004\342A\001\002\022I\n\016serving_config\030\003 \001(\t" + + "B1\372A.\n,discoveryengine.googleapis.com/Se" + + "rvingConfig\022H\n\014conversation\030\005 \001(\01322.goog" + + "le.cloud.discoveryengine.v1alpha.Convers" + + "ation\022\023\n\013safe_search\030\006 \001(\010\022f\n\013user_label" + + "s\030\007 \003(\0132Q.google.cloud.discoveryengine.v" + + "1alpha.ConverseConversationRequest.UserL" + + "abelsEntry\022g\n\014summary_spec\030\010 \001(\0132Q.googl" + + "e.cloud.discoveryengine.v1alpha.SearchRe" + + "quest.ContentSearchSpec.SummarySpec\0321\n\017U" + + "serLabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001" + + "(\t:\0028\001\"\232\002\n\034ConverseConversationResponse\022" + + ":\n\005reply\030\001 \001(\0132+.google.cloud.discoverye" + + "ngine.v1alpha.Reply\022H\n\014conversation\030\002 \001(" + + "\01322.google.cloud.discoveryengine.v1alpha" + + ".Conversation\022\031\n\021related_questions\030\006 \003(\t" + + "\022Y\n\016search_results\030\003 \003(\0132A.google.cloud." + + "discoveryengine.v1alpha.SearchResponse.S" + + "earchResult\"\256\001\n\031CreateConversationReques" + + "t\022A\n\006parent\030\001 \001(\tB1\342A\001\002\372A*\n(discoveryeng" + + "ine.googleapis.com/DataStore\022N\n\014conversa" + + "tion\030\002 \001(\01322.google.cloud.discoveryengin" + + "e.v1alpha.ConversationB\004\342A\001\002\"\234\001\n\031UpdateC" + + "onversationRequest\022N\n\014conversation\030\001 \001(\013" + + "22.google.cloud.discoveryengine.v1alpha." + + "ConversationB\004\342A\001\002\022/\n\013update_mask\030\002 \001(\0132" + + "\032.google.protobuf.FieldMask\"_\n\031DeleteCon" + + "versationRequest\022B\n\004name\030\001 \001(\tB4\342A\001\002\372A-\n" + + "+discoveryengine.googleapis.com/Conversa" + + "tion\"\\\n\026GetConversationRequest\022B\n\004name\030\001" + + " \001(\tB4\342A\001\002\372A-\n+discoveryengine.googleapi" + + "s.com/Conversation\"\246\001\n\030ListConversations" + + "Request\022A\n\006parent\030\001 \001(\tB1\342A\001\002\372A*\n(discov" + + "eryengine.googleapis.com/DataStore\022\021\n\tpa" + + "ge_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006fil" + + "ter\030\004 \001(\t\022\020\n\010order_by\030\005 \001(\t\"\177\n\031ListConve" + + "rsationsResponse\022I\n\rconversations\030\001 \003(\0132" + + "2.google.cloud.discoveryengine.v1alpha.C" + + "onversation\022\027\n\017next_page_token\030\002 \001(\t2\315\020\n" + + "\033ConversationalSearchService\022\346\002\n\024Convers" + + "eConversation\022A.google.cloud.discoveryen" + + "gine.v1alpha.ConverseConversationRequest" + + "\032B.google.cloud.discoveryengine.v1alpha." + + "ConverseConversationResponse\"\306\001\332A\nname,q" + + "uery\202\323\344\223\002\262\001\"L/v1alpha/{name=projects/*/l" + + "ocations/*/dataStores/*/conversations/*}" + + ":converse:\001*Z_\"Z/v1alpha/{name=projects/" + + "*/locations/*/collections/*/dataStores/*" + + "/conversations/*}:converse:\001*\022\337\002\n\022Create" + + "Conversation\022?.google.cloud.discoveryeng" + + "ine.v1alpha.CreateConversationRequest\0322." + + "google.cloud.discoveryengine.v1alpha.Con" + + "versation\"\323\001\332A\023parent,conversation\202\323\344\223\002\266" + + "\001\"C/v1alpha/{parent=projects/*/locations" + + "/*/dataStores/*}/conversations:\014conversa" + + "tionZa\"Q/v1alpha/{parent=projects/*/loca" + + "tions/*/collections/*/dataStores/*}/conv" + + "ersations:\014conversation\022\230\002\n\022DeleteConver" + + "sation\022?.google.cloud.discoveryengine.v1" + + "alpha.DeleteConversationRequest\032\026.google" + + ".protobuf.Empty\"\250\001\332A\004name\202\323\344\223\002\232\001*C/v1alp" + + "ha/{name=projects/*/locations/*/dataStor" + + "es/*/conversations/*}ZS*Q/v1alpha/{name=" + + "projects/*/locations/*/collections/*/dat" + + "aStores/*/conversations/*}\022\376\002\n\022UpdateCon" + + "versation\022?.google.cloud.discoveryengine" + + ".v1alpha.UpdateConversationRequest\0322.goo" + + "gle.cloud.discoveryengine.v1alpha.Conver" + + "sation\"\362\001\332A\030conversation,update_mask\202\323\344\223" + + "\002\320\0012P/v1alpha/{conversation.name=project" + + "s/*/locations/*/dataStores/*/conversatio" + + "ns/*}:\014conversationZn2^/v1alpha/{convers" + + "ation.name=projects/*/locations/*/collec" + + "tions/*/dataStores/*/conversations/*}:\014c" + + "onversation\022\256\002\n\017GetConversation\022<.google" + + ".cloud.discoveryengine.v1alpha.GetConver" + + "sationRequest\0322.google.cloud.discoveryen" + + "gine.v1alpha.Conversation\"\250\001\332A\004name\202\323\344\223\002" + + "\232\001\022C/v1alpha/{name=projects/*/locations/" + + "*/dataStores/*/conversations/*}ZS\022Q/v1al" + + "pha/{name=projects/*/locations/*/collect" + + "ions/*/dataStores/*/conversations/*}\022\301\002\n" + + "\021ListConversations\022>.google.cloud.discov" + + "eryengine.v1alpha.ListConversationsReque" + + "st\032?.google.cloud.discoveryengine.v1alph" + + "a.ListConversationsResponse\"\252\001\332A\006parent\202" + + "\323\344\223\002\232\001\022C/v1alpha/{parent=projects/*/loca" + + "tions/*/dataStores/*}/conversationsZS\022Q/" + + "v1alpha/{parent=projects/*/locations/*/c" + + "ollections/*/dataStores/*}/conversations" + + "\032R\312A\036discoveryengine.googleapis.com\322A.ht" + + "tps://www.googleapis.com/auth/cloud-plat" + + "formB\254\002\n(com.google.cloud.discoveryengin" + + "e.v1alphaB ConversationalSearchServicePr" + + "otoP\001ZRcloud.google.com/go/discoveryengi" + + "ne/apiv1alpha/discoveryenginepb;discover" + + "yenginepb\242\002\017DISCOVERYENGINE\252\002$Google.Clo" + + "ud.DiscoveryEngine.V1Alpha\312\002$Google\\Clou" + + "d\\DiscoveryEngine\\V1alpha\352\002\'Google::Clou" + + "d::DiscoveryEngine::V1alphab\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.discoveryengine.v1alpha.ConversationProto.getDescriptor(), + com.google.cloud.discoveryengine.v1alpha.SearchServiceProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationRequest_descriptor, + new java.lang.String[] { + "Name", + "Query", + "ServingConfig", + "Conversation", + "SafeSearch", + "UserLabels", + "SummarySpec", + }); + internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationRequest_UserLabelsEntry_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationRequest_UserLabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationRequest_UserLabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationResponse_descriptor, + new java.lang.String[] { + "Reply", "Conversation", "RelatedQuestions", "SearchResults", + }); + internal_static_google_cloud_discoveryengine_v1alpha_CreateConversationRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_discoveryengine_v1alpha_CreateConversationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_CreateConversationRequest_descriptor, + new java.lang.String[] { + "Parent", "Conversation", + }); + internal_static_google_cloud_discoveryengine_v1alpha_UpdateConversationRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_discoveryengine_v1alpha_UpdateConversationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_UpdateConversationRequest_descriptor, + new java.lang.String[] { + "Conversation", "UpdateMask", + }); + internal_static_google_cloud_discoveryengine_v1alpha_DeleteConversationRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_discoveryengine_v1alpha_DeleteConversationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_DeleteConversationRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_discoveryengine_v1alpha_GetConversationRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_discoveryengine_v1alpha_GetConversationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_GetConversationRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_discoveryengine_v1alpha_ListConversationsRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_discoveryengine_v1alpha_ListConversationsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_ListConversationsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_discoveryengine_v1alpha_ListConversationsResponse_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_discoveryengine_v1alpha_ListConversationsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_ListConversationsResponse_descriptor, + new java.lang.String[] { + "Conversations", "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.discoveryengine.v1alpha.ConversationProto.getDescriptor(); + com.google.cloud.discoveryengine.v1alpha.SearchServiceProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConverseConversationRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConverseConversationRequest.java new file mode 100644 index 000000000000..69d2fc1342a2 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConverseConversationRequest.java @@ -0,0 +1,2387 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request message for
+ * [ConversationalSearchService.ConverseConversation][google.cloud.discoveryengine.v1alpha.ConversationalSearchService.ConverseConversation]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ConverseConversationRequest} + */ +public final class ConverseConversationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.ConverseConversationRequest) + ConverseConversationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConverseConversationRequest.newBuilder() to construct. + private ConverseConversationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConverseConversationRequest() { + name_ = ""; + servingConfig_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConverseConversationRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetUserLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest.class, + com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The resource name of the Conversation to get. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
+   * Use
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
+   * to activate auto session mode, which automatically creates a new
+   * conversation inside a ConverseConversation session.
+   * 
+ * + * + * 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 Conversation to get. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
+   * Use
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
+   * to activate auto session mode, which automatically creates a new
+   * conversation inside a ConverseConversation session.
+   * 
+ * + * + * 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; + } + } + + public static final int QUERY_FIELD_NUMBER = 2; + private com.google.cloud.discoveryengine.v1alpha.TextInput query_; + /** + * + * + *
+   * Required. Current user input.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the query field is set. + */ + @java.lang.Override + public boolean hasQuery() { + return query_ != null; + } + /** + * + * + *
+   * Required. Current user input.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The query. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.TextInput getQuery() { + return query_ == null + ? com.google.cloud.discoveryengine.v1alpha.TextInput.getDefaultInstance() + : query_; + } + /** + * + * + *
+   * Required. Current user input.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.TextInputOrBuilder getQueryOrBuilder() { + return query_ == null + ? com.google.cloud.discoveryengine.v1alpha.TextInput.getDefaultInstance() + : query_; + } + + public static final int SERVING_CONFIG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object servingConfig_ = ""; + /** + * + * + *
+   * The resource name of the Serving Config to use. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
+   * If this is not set, the default serving config will be used.
+   * 
+ * + * string serving_config = 3 [(.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; + } + } + /** + * + * + *
+   * The resource name of the Serving Config to use. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
+   * If this is not set, the default serving config will be used.
+   * 
+ * + * string serving_config = 3 [(.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 CONVERSATION_FIELD_NUMBER = 5; + private com.google.cloud.discoveryengine.v1alpha.Conversation conversation_; + /** + * + * + *
+   * The conversation to be used by auto session only. The name field will be
+   * ignored as we automatically assign new name for the conversation in auto
+   * session.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 5; + * + * @return Whether the conversation field is set. + */ + @java.lang.Override + public boolean hasConversation() { + return conversation_ != null; + } + /** + * + * + *
+   * The conversation to be used by auto session only. The name field will be
+   * ignored as we automatically assign new name for the conversation in auto
+   * session.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 5; + * + * @return The conversation. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Conversation getConversation() { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance() + : conversation_; + } + /** + * + * + *
+   * The conversation to be used by auto session only. The name field will be
+   * ignored as we automatically assign new name for the conversation in auto
+   * session.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 5; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder getConversationOrBuilder() { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance() + : conversation_; + } + + public static final int SAFE_SEARCH_FIELD_NUMBER = 6; + private boolean safeSearch_ = false; + /** + * + * + *
+   * Whether to turn on safe search.
+   * 
+ * + * bool safe_search = 6; + * + * @return The safeSearch. + */ + @java.lang.Override + public boolean getSafeSearch() { + return safeSearch_; + } + + public static final int USER_LABELS_FIELD_NUMBER = 7; + + private static final class UserLabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationRequest_UserLabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField userLabels_; + + private com.google.protobuf.MapField internalGetUserLabels() { + if (userLabels_ == null) { + return com.google.protobuf.MapField.emptyMapField(UserLabelsDefaultEntryHolder.defaultEntry); + } + return userLabels_; + } + + public int getUserLabelsCount() { + return internalGetUserLabels().getMap().size(); + } + /** + * + * + *
+   * The user 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> user_labels = 7; + */ + @java.lang.Override + public boolean containsUserLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetUserLabels().getMap().containsKey(key); + } + /** Use {@link #getUserLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getUserLabels() { + return getUserLabelsMap(); + } + /** + * + * + *
+   * The user 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> user_labels = 7; + */ + @java.lang.Override + public java.util.Map getUserLabelsMap() { + return internalGetUserLabels().getMap(); + } + /** + * + * + *
+   * The user 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> user_labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * The user 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> user_labels = 7; + */ + @java.lang.Override + public java.lang.String getUserLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int SUMMARY_SPEC_FIELD_NUMBER = 8; + private com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + summarySpec_; + /** + * + * + *
+   * A specification for configuring the summary returned in the response.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + * + * @return Whether the summarySpec field is set. + */ + @java.lang.Override + public boolean hasSummarySpec() { + return summarySpec_ != null; + } + /** + * + * + *
+   * A specification for configuring the summary returned in the response.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + * + * @return The summarySpec. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + getSummarySpec() { + return summarySpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance() + : summarySpec_; + } + /** + * + * + *
+   * A specification for configuring the summary returned in the response.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpecOrBuilder + getSummarySpecOrBuilder() { + return summarySpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance() + : summarySpec_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (query_ != null) { + output.writeMessage(2, getQuery()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(servingConfig_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, servingConfig_); + } + if (conversation_ != null) { + output.writeMessage(5, getConversation()); + } + if (safeSearch_ != false) { + output.writeBool(6, safeSearch_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetUserLabels(), UserLabelsDefaultEntryHolder.defaultEntry, 7); + if (summarySpec_ != null) { + output.writeMessage(8, getSummarySpec()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (query_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getQuery()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(servingConfig_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, servingConfig_); + } + if (conversation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getConversation()); + } + if (safeSearch_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, safeSearch_); + } + for (java.util.Map.Entry entry : + internalGetUserLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry userLabels__ = + UserLabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, userLabels__); + } + if (summarySpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getSummarySpec()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest other = + (com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasQuery() != other.hasQuery()) return false; + if (hasQuery()) { + if (!getQuery().equals(other.getQuery())) return false; + } + if (!getServingConfig().equals(other.getServingConfig())) return false; + if (hasConversation() != other.hasConversation()) return false; + if (hasConversation()) { + if (!getConversation().equals(other.getConversation())) return false; + } + if (getSafeSearch() != other.getSafeSearch()) return false; + if (!internalGetUserLabels().equals(other.internalGetUserLabels())) return false; + if (hasSummarySpec() != other.hasSummarySpec()) return false; + if (hasSummarySpec()) { + if (!getSummarySpec().equals(other.getSummarySpec())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasQuery()) { + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + } + hash = (37 * hash) + SERVING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getServingConfig().hashCode(); + if (hasConversation()) { + hash = (37 * hash) + CONVERSATION_FIELD_NUMBER; + hash = (53 * hash) + getConversation().hashCode(); + } + hash = (37 * hash) + SAFE_SEARCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSafeSearch()); + if (!internalGetUserLabels().getMap().isEmpty()) { + hash = (37 * hash) + USER_LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetUserLabels().hashCode(); + } + if (hasSummarySpec()) { + hash = (37 * hash) + SUMMARY_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getSummarySpec().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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
+   * [ConversationalSearchService.ConverseConversation][google.cloud.discoveryengine.v1alpha.ConversationalSearchService.ConverseConversation]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ConverseConversationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.ConverseConversationRequest) + com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetUserLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 7: + return internalGetMutableUserLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest.class, + com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + query_ = null; + if (queryBuilder_ != null) { + queryBuilder_.dispose(); + queryBuilder_ = null; + } + servingConfig_ = ""; + conversation_ = null; + if (conversationBuilder_ != null) { + conversationBuilder_.dispose(); + conversationBuilder_ = null; + } + safeSearch_ = false; + internalGetMutableUserLabels().clear(); + summarySpec_ = null; + if (summarySpecBuilder_ != null) { + summarySpecBuilder_.dispose(); + summarySpecBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest build() { + com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest result = + new com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.query_ = queryBuilder_ == null ? query_ : queryBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.servingConfig_ = servingConfig_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.conversation_ = + conversationBuilder_ == null ? conversation_ : conversationBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.safeSearch_ = safeSearch_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.userLabels_ = internalGetUserLabels(); + result.userLabels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.summarySpec_ = + summarySpecBuilder_ == null ? summarySpec_ : summarySpecBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasQuery()) { + mergeQuery(other.getQuery()); + } + if (!other.getServingConfig().isEmpty()) { + servingConfig_ = other.servingConfig_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasConversation()) { + mergeConversation(other.getConversation()); + } + if (other.getSafeSearch() != false) { + setSafeSearch(other.getSafeSearch()); + } + internalGetMutableUserLabels().mergeFrom(other.internalGetUserLabels()); + bitField0_ |= 0x00000020; + if (other.hasSummarySpec()) { + mergeSummarySpec(other.getSummarySpec()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getQueryFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + servingConfig_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 42: + { + input.readMessage(getConversationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 48: + { + safeSearch_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 48 + case 58: + { + com.google.protobuf.MapEntry userLabels__ = + input.readMessage( + UserLabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableUserLabels() + .getMutableMap() + .put(userLabels__.getKey(), userLabels__.getValue()); + bitField0_ |= 0x00000020; + break; + } // case 58 + case 66: + { + input.readMessage(getSummarySpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the Conversation to get. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
+     * Use
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
+     * to activate auto session mode, which automatically creates a new
+     * conversation inside a ConverseConversation session.
+     * 
+ * + * + * 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 Conversation to get. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
+     * Use
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
+     * to activate auto session mode, which automatically creates a new
+     * conversation inside a ConverseConversation session.
+     * 
+ * + * + * 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 Conversation to get. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
+     * Use
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
+     * to activate auto session mode, which automatically creates a new
+     * conversation inside a ConverseConversation session.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Conversation to get. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
+     * Use
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
+     * to activate auto session mode, which automatically creates a new
+     * conversation inside a ConverseConversation session.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Conversation to get. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
+     * Use
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
+     * to activate auto session mode, which automatically creates a new
+     * conversation inside a ConverseConversation session.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1alpha.TextInput query_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.TextInput, + com.google.cloud.discoveryengine.v1alpha.TextInput.Builder, + com.google.cloud.discoveryengine.v1alpha.TextInputOrBuilder> + queryBuilder_; + /** + * + * + *
+     * Required. Current user input.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the query field is set. + */ + public boolean hasQuery() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. Current user input.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The query. + */ + public com.google.cloud.discoveryengine.v1alpha.TextInput getQuery() { + if (queryBuilder_ == null) { + return query_ == null + ? com.google.cloud.discoveryengine.v1alpha.TextInput.getDefaultInstance() + : query_; + } else { + return queryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Current user input.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQuery(com.google.cloud.discoveryengine.v1alpha.TextInput value) { + if (queryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + query_ = value; + } else { + queryBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Current user input.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQuery( + com.google.cloud.discoveryengine.v1alpha.TextInput.Builder builderForValue) { + if (queryBuilder_ == null) { + query_ = builderForValue.build(); + } else { + queryBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Current user input.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeQuery(com.google.cloud.discoveryengine.v1alpha.TextInput value) { + if (queryBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && query_ != null + && query_ != com.google.cloud.discoveryengine.v1alpha.TextInput.getDefaultInstance()) { + getQueryBuilder().mergeFrom(value); + } else { + query_ = value; + } + } else { + queryBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Current user input.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearQuery() { + bitField0_ = (bitField0_ & ~0x00000002); + query_ = null; + if (queryBuilder_ != null) { + queryBuilder_.dispose(); + queryBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Current user input.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.TextInput.Builder getQueryBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getQueryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Current user input.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.TextInputOrBuilder getQueryOrBuilder() { + if (queryBuilder_ != null) { + return queryBuilder_.getMessageOrBuilder(); + } else { + return query_ == null + ? com.google.cloud.discoveryengine.v1alpha.TextInput.getDefaultInstance() + : query_; + } + } + /** + * + * + *
+     * Required. Current user input.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.TextInput, + com.google.cloud.discoveryengine.v1alpha.TextInput.Builder, + com.google.cloud.discoveryengine.v1alpha.TextInputOrBuilder> + getQueryFieldBuilder() { + if (queryBuilder_ == null) { + queryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.TextInput, + com.google.cloud.discoveryengine.v1alpha.TextInput.Builder, + com.google.cloud.discoveryengine.v1alpha.TextInputOrBuilder>( + getQuery(), getParentForChildren(), isClean()); + query_ = null; + } + return queryBuilder_; + } + + private java.lang.Object servingConfig_ = ""; + /** + * + * + *
+     * The resource name of the Serving Config to use. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
+     * If this is not set, the default serving config will be used.
+     * 
+ * + * string serving_config = 3 [(.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; + } + } + /** + * + * + *
+     * The resource name of the Serving Config to use. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
+     * If this is not set, the default serving config will be used.
+     * 
+ * + * string serving_config = 3 [(.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; + } + } + /** + * + * + *
+     * The resource name of the Serving Config to use. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
+     * If this is not set, the default serving config will be used.
+     * 
+ * + * string serving_config = 3 [(.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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the Serving Config to use. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
+     * If this is not set, the default serving config will be used.
+     * 
+ * + * string serving_config = 3 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearServingConfig() { + servingConfig_ = getDefaultInstance().getServingConfig(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the Serving Config to use. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
+     * If this is not set, the default serving config will be used.
+     * 
+ * + * string serving_config = 3 [(.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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1alpha.Conversation conversation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Conversation, + com.google.cloud.discoveryengine.v1alpha.Conversation.Builder, + com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder> + conversationBuilder_; + /** + * + * + *
+     * The conversation to be used by auto session only. The name field will be
+     * ignored as we automatically assign new name for the conversation in auto
+     * session.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 5; + * + * @return Whether the conversation field is set. + */ + public boolean hasConversation() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * The conversation to be used by auto session only. The name field will be
+     * ignored as we automatically assign new name for the conversation in auto
+     * session.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 5; + * + * @return The conversation. + */ + public com.google.cloud.discoveryengine.v1alpha.Conversation getConversation() { + if (conversationBuilder_ == null) { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance() + : conversation_; + } else { + return conversationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The conversation to be used by auto session only. The name field will be
+     * ignored as we automatically assign new name for the conversation in auto
+     * session.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 5; + */ + public Builder setConversation(com.google.cloud.discoveryengine.v1alpha.Conversation value) { + if (conversationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + conversation_ = value; + } else { + conversationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The conversation to be used by auto session only. The name field will be
+     * ignored as we automatically assign new name for the conversation in auto
+     * session.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 5; + */ + public Builder setConversation( + com.google.cloud.discoveryengine.v1alpha.Conversation.Builder builderForValue) { + if (conversationBuilder_ == null) { + conversation_ = builderForValue.build(); + } else { + conversationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The conversation to be used by auto session only. The name field will be
+     * ignored as we automatically assign new name for the conversation in auto
+     * session.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 5; + */ + public Builder mergeConversation(com.google.cloud.discoveryengine.v1alpha.Conversation value) { + if (conversationBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && conversation_ != null + && conversation_ + != com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance()) { + getConversationBuilder().mergeFrom(value); + } else { + conversation_ = value; + } + } else { + conversationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The conversation to be used by auto session only. The name field will be
+     * ignored as we automatically assign new name for the conversation in auto
+     * session.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 5; + */ + public Builder clearConversation() { + bitField0_ = (bitField0_ & ~0x00000008); + conversation_ = null; + if (conversationBuilder_ != null) { + conversationBuilder_.dispose(); + conversationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The conversation to be used by auto session only. The name field will be
+     * ignored as we automatically assign new name for the conversation in auto
+     * session.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 5; + */ + public com.google.cloud.discoveryengine.v1alpha.Conversation.Builder getConversationBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getConversationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The conversation to be used by auto session only. The name field will be
+     * ignored as we automatically assign new name for the conversation in auto
+     * session.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 5; + */ + public com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder + getConversationOrBuilder() { + if (conversationBuilder_ != null) { + return conversationBuilder_.getMessageOrBuilder(); + } else { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance() + : conversation_; + } + } + /** + * + * + *
+     * The conversation to be used by auto session only. The name field will be
+     * ignored as we automatically assign new name for the conversation in auto
+     * session.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Conversation, + com.google.cloud.discoveryengine.v1alpha.Conversation.Builder, + com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder> + getConversationFieldBuilder() { + if (conversationBuilder_ == null) { + conversationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Conversation, + com.google.cloud.discoveryengine.v1alpha.Conversation.Builder, + com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder>( + getConversation(), getParentForChildren(), isClean()); + conversation_ = null; + } + return conversationBuilder_; + } + + private boolean safeSearch_; + /** + * + * + *
+     * Whether to turn on safe search.
+     * 
+ * + * bool safe_search = 6; + * + * @return The safeSearch. + */ + @java.lang.Override + public boolean getSafeSearch() { + return safeSearch_; + } + /** + * + * + *
+     * Whether to turn on safe search.
+     * 
+ * + * bool safe_search = 6; + * + * @param value The safeSearch to set. + * @return This builder for chaining. + */ + public Builder setSafeSearch(boolean value) { + + safeSearch_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether to turn on safe search.
+     * 
+ * + * bool safe_search = 6; + * + * @return This builder for chaining. + */ + public Builder clearSafeSearch() { + bitField0_ = (bitField0_ & ~0x00000010); + safeSearch_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.MapField userLabels_; + + private com.google.protobuf.MapField + internalGetUserLabels() { + if (userLabels_ == null) { + return com.google.protobuf.MapField.emptyMapField( + UserLabelsDefaultEntryHolder.defaultEntry); + } + return userLabels_; + } + + private com.google.protobuf.MapField + internalGetMutableUserLabels() { + if (userLabels_ == null) { + userLabels_ = + com.google.protobuf.MapField.newMapField(UserLabelsDefaultEntryHolder.defaultEntry); + } + if (!userLabels_.isMutable()) { + userLabels_ = userLabels_.copy(); + } + bitField0_ |= 0x00000020; + onChanged(); + return userLabels_; + } + + public int getUserLabelsCount() { + return internalGetUserLabels().getMap().size(); + } + /** + * + * + *
+     * The user 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> user_labels = 7; + */ + @java.lang.Override + public boolean containsUserLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetUserLabels().getMap().containsKey(key); + } + /** Use {@link #getUserLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getUserLabels() { + return getUserLabelsMap(); + } + /** + * + * + *
+     * The user 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> user_labels = 7; + */ + @java.lang.Override + public java.util.Map getUserLabelsMap() { + return internalGetUserLabels().getMap(); + } + /** + * + * + *
+     * The user 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> user_labels = 7; + */ + @java.lang.Override + public /* nullable */ java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The user 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> user_labels = 7; + */ + @java.lang.Override + public java.lang.String getUserLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearUserLabels() { + bitField0_ = (bitField0_ & ~0x00000020); + internalGetMutableUserLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * The user 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> user_labels = 7; + */ + public Builder removeUserLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableUserLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableUserLabels() { + bitField0_ |= 0x00000020; + return internalGetMutableUserLabels().getMutableMap(); + } + /** + * + * + *
+     * The user 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> user_labels = 7; + */ + public Builder putUserLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableUserLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000020; + return this; + } + /** + * + * + *
+     * The user 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> user_labels = 7; + */ + public Builder putAllUserLabels(java.util.Map values) { + internalGetMutableUserLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000020; + return this; + } + + private com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + summarySpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + .Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpecOrBuilder> + summarySpecBuilder_; + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + * + * @return Whether the summarySpec field is set. + */ + public boolean hasSummarySpec() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + * + * @return The summarySpec. + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + getSummarySpec() { + if (summarySpecBuilder_ == null) { + return summarySpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance() + : summarySpec_; + } else { + return summarySpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + public Builder setSummarySpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + value) { + if (summarySpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + summarySpec_ = value; + } else { + summarySpecBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + public Builder setSummarySpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec.Builder + builderForValue) { + if (summarySpecBuilder_ == null) { + summarySpec_ = builderForValue.build(); + } else { + summarySpecBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + public Builder mergeSummarySpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + value) { + if (summarySpecBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && summarySpec_ != null + && summarySpec_ + != com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec.getDefaultInstance()) { + getSummarySpecBuilder().mergeFrom(value); + } else { + summarySpec_ = value; + } + } else { + summarySpecBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + public Builder clearSummarySpec() { + bitField0_ = (bitField0_ & ~0x00000040); + summarySpec_ = null; + if (summarySpecBuilder_ != null) { + summarySpecBuilder_.dispose(); + summarySpecBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + .Builder + getSummarySpecBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getSummarySpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpecOrBuilder + getSummarySpecOrBuilder() { + if (summarySpecBuilder_ != null) { + return summarySpecBuilder_.getMessageOrBuilder(); + } else { + return summarySpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance() + : summarySpec_; + } + } + /** + * + * + *
+     * A specification for configuring the summary returned in the response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + .Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpecOrBuilder> + getSummarySpecFieldBuilder() { + if (summarySpecBuilder_ == null) { + summarySpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + .Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpecOrBuilder>(getSummarySpec(), getParentForChildren(), isClean()); + summarySpec_ = null; + } + return summarySpecBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.ConverseConversationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.ConverseConversationRequest) + private static final com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConverseConversationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConverseConversationRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConverseConversationRequestOrBuilder.java new file mode 100644 index 000000000000..555ac4aece2a --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConverseConversationRequestOrBuilder.java @@ -0,0 +1,369 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface ConverseConversationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.ConverseConversationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Conversation to get. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
+   * Use
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
+   * to activate auto session mode, which automatically creates a new
+   * conversation inside a ConverseConversation session.
+   * 
+ * + * + * 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 Conversation to get. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
+   * Use
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
+   * to activate auto session mode, which automatically creates a new
+   * conversation inside a ConverseConversation session.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Current user input.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the query field is set. + */ + boolean hasQuery(); + /** + * + * + *
+   * Required. Current user input.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The query. + */ + com.google.cloud.discoveryengine.v1alpha.TextInput getQuery(); + /** + * + * + *
+   * Required. Current user input.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.TextInput query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.discoveryengine.v1alpha.TextInputOrBuilder getQueryOrBuilder(); + + /** + * + * + *
+   * The resource name of the Serving Config to use. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
+   * If this is not set, the default serving config will be used.
+   * 
+ * + * string serving_config = 3 [(.google.api.resource_reference) = { ... } + * + * @return The servingConfig. + */ + java.lang.String getServingConfig(); + /** + * + * + *
+   * The resource name of the Serving Config to use. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
+   * If this is not set, the default serving config will be used.
+   * 
+ * + * string serving_config = 3 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for servingConfig. + */ + com.google.protobuf.ByteString getServingConfigBytes(); + + /** + * + * + *
+   * The conversation to be used by auto session only. The name field will be
+   * ignored as we automatically assign new name for the conversation in auto
+   * session.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 5; + * + * @return Whether the conversation field is set. + */ + boolean hasConversation(); + /** + * + * + *
+   * The conversation to be used by auto session only. The name field will be
+   * ignored as we automatically assign new name for the conversation in auto
+   * session.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 5; + * + * @return The conversation. + */ + com.google.cloud.discoveryengine.v1alpha.Conversation getConversation(); + /** + * + * + *
+   * The conversation to be used by auto session only. The name field will be
+   * ignored as we automatically assign new name for the conversation in auto
+   * session.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 5; + */ + com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder getConversationOrBuilder(); + + /** + * + * + *
+   * Whether to turn on safe search.
+   * 
+ * + * bool safe_search = 6; + * + * @return The safeSearch. + */ + boolean getSafeSearch(); + + /** + * + * + *
+   * The user 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> user_labels = 7; + */ + int getUserLabelsCount(); + /** + * + * + *
+   * The user 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> user_labels = 7; + */ + boolean containsUserLabels(java.lang.String key); + /** Use {@link #getUserLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getUserLabels(); + /** + * + * + *
+   * The user 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> user_labels = 7; + */ + java.util.Map getUserLabelsMap(); + /** + * + * + *
+   * The user 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> user_labels = 7; + */ + /* nullable */ + java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * The user 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> user_labels = 7; + */ + java.lang.String getUserLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * A specification for configuring the summary returned in the response.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + * + * @return Whether the summarySpec field is set. + */ + boolean hasSummarySpec(); + /** + * + * + *
+   * A specification for configuring the summary returned in the response.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + * + * @return The summarySpec. + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + getSummarySpec(); + /** + * + * + *
+   * A specification for configuring the summary returned in the response.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpecOrBuilder + getSummarySpecOrBuilder(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConverseConversationResponse.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConverseConversationResponse.java new file mode 100644 index 000000000000..d17ff7a1cc2c --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConverseConversationResponse.java @@ -0,0 +1,1844 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Response message for
+ * [ConversationalSearchService.ConverseConversation][google.cloud.discoveryengine.v1alpha.ConversationalSearchService.ConverseConversation]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ConverseConversationResponse} + */ +public final class ConverseConversationResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.ConverseConversationResponse) + ConverseConversationResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConverseConversationResponse.newBuilder() to construct. + private ConverseConversationResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConverseConversationResponse() { + relatedQuestions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + searchResults_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConverseConversationResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse.class, + com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse.Builder.class); + } + + public static final int REPLY_FIELD_NUMBER = 1; + private com.google.cloud.discoveryengine.v1alpha.Reply reply_; + /** + * + * + *
+   * Answer to the current query.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 1; + * + * @return Whether the reply field is set. + */ + @java.lang.Override + public boolean hasReply() { + return reply_ != null; + } + /** + * + * + *
+   * Answer to the current query.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 1; + * + * @return The reply. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Reply getReply() { + return reply_ == null + ? com.google.cloud.discoveryengine.v1alpha.Reply.getDefaultInstance() + : reply_; + } + /** + * + * + *
+   * Answer to the current query.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 1; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ReplyOrBuilder getReplyOrBuilder() { + return reply_ == null + ? com.google.cloud.discoveryengine.v1alpha.Reply.getDefaultInstance() + : reply_; + } + + public static final int CONVERSATION_FIELD_NUMBER = 2; + private com.google.cloud.discoveryengine.v1alpha.Conversation conversation_; + /** + * + * + *
+   * Updated conversation including the answer.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2; + * + * @return Whether the conversation field is set. + */ + @java.lang.Override + public boolean hasConversation() { + return conversation_ != null; + } + /** + * + * + *
+   * Updated conversation including the answer.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2; + * + * @return The conversation. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Conversation getConversation() { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance() + : conversation_; + } + /** + * + * + *
+   * Updated conversation including the answer.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder getConversationOrBuilder() { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance() + : conversation_; + } + + public static final int RELATED_QUESTIONS_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList relatedQuestions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Suggested related questions.
+   * 
+ * + * repeated string related_questions = 6; + * + * @return A list containing the relatedQuestions. + */ + public com.google.protobuf.ProtocolStringList getRelatedQuestionsList() { + return relatedQuestions_; + } + /** + * + * + *
+   * Suggested related questions.
+   * 
+ * + * repeated string related_questions = 6; + * + * @return The count of relatedQuestions. + */ + public int getRelatedQuestionsCount() { + return relatedQuestions_.size(); + } + /** + * + * + *
+   * Suggested related questions.
+   * 
+ * + * repeated string related_questions = 6; + * + * @param index The index of the element to return. + * @return The relatedQuestions at the given index. + */ + public java.lang.String getRelatedQuestions(int index) { + return relatedQuestions_.get(index); + } + /** + * + * + *
+   * Suggested related questions.
+   * 
+ * + * repeated string related_questions = 6; + * + * @param index The index of the value to return. + * @return The bytes of the relatedQuestions at the given index. + */ + public com.google.protobuf.ByteString getRelatedQuestionsBytes(int index) { + return relatedQuestions_.getByteString(index); + } + + public static final int SEARCH_RESULTS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List + searchResults_; + /** + * + * + *
+   * Search Results.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + @java.lang.Override + public java.util.List + getSearchResultsList() { + return searchResults_; + } + /** + * + * + *
+   * Search Results.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResultOrBuilder> + getSearchResultsOrBuilderList() { + return searchResults_; + } + /** + * + * + *
+   * Search Results.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + @java.lang.Override + public int getSearchResultsCount() { + return searchResults_.size(); + } + /** + * + * + *
+   * Search Results.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult getSearchResults( + int index) { + return searchResults_.get(index); + } + /** + * + * + *
+   * Search Results.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResultOrBuilder + getSearchResultsOrBuilder(int index) { + return searchResults_.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 (reply_ != null) { + output.writeMessage(1, getReply()); + } + if (conversation_ != null) { + output.writeMessage(2, getConversation()); + } + for (int i = 0; i < searchResults_.size(); i++) { + output.writeMessage(3, searchResults_.get(i)); + } + for (int i = 0; i < relatedQuestions_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, relatedQuestions_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (reply_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getReply()); + } + if (conversation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getConversation()); + } + for (int i = 0; i < searchResults_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, searchResults_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < relatedQuestions_.size(); i++) { + dataSize += computeStringSizeNoTag(relatedQuestions_.getRaw(i)); + } + size += dataSize; + size += 1 * getRelatedQuestionsList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse other = + (com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse) obj; + + if (hasReply() != other.hasReply()) return false; + if (hasReply()) { + if (!getReply().equals(other.getReply())) return false; + } + if (hasConversation() != other.hasConversation()) return false; + if (hasConversation()) { + if (!getConversation().equals(other.getConversation())) return false; + } + if (!getRelatedQuestionsList().equals(other.getRelatedQuestionsList())) return false; + if (!getSearchResultsList().equals(other.getSearchResultsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasReply()) { + hash = (37 * hash) + REPLY_FIELD_NUMBER; + hash = (53 * hash) + getReply().hashCode(); + } + if (hasConversation()) { + hash = (37 * hash) + CONVERSATION_FIELD_NUMBER; + hash = (53 * hash) + getConversation().hashCode(); + } + if (getRelatedQuestionsCount() > 0) { + hash = (37 * hash) + RELATED_QUESTIONS_FIELD_NUMBER; + hash = (53 * hash) + getRelatedQuestionsList().hashCode(); + } + if (getSearchResultsCount() > 0) { + hash = (37 * hash) + SEARCH_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getSearchResultsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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
+   * [ConversationalSearchService.ConverseConversation][google.cloud.discoveryengine.v1alpha.ConversationalSearchService.ConverseConversation]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ConverseConversationResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.ConverseConversationResponse) + com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse.class, + com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + reply_ = null; + if (replyBuilder_ != null) { + replyBuilder_.dispose(); + replyBuilder_ = null; + } + conversation_ = null; + if (conversationBuilder_ != null) { + conversationBuilder_.dispose(); + conversationBuilder_ = null; + } + relatedQuestions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + if (searchResultsBuilder_ == null) { + searchResults_ = java.util.Collections.emptyList(); + } else { + searchResults_ = null; + searchResultsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ConverseConversationResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse build() { + com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse buildPartial() { + com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse result = + new com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse result) { + if (searchResultsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + searchResults_ = java.util.Collections.unmodifiableList(searchResults_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.searchResults_ = searchResults_; + } else { + result.searchResults_ = searchResultsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.reply_ = replyBuilder_ == null ? reply_ : replyBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.conversation_ = + conversationBuilder_ == null ? conversation_ : conversationBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + relatedQuestions_.makeImmutable(); + result.relatedQuestions_ = relatedQuestions_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse + .getDefaultInstance()) return this; + if (other.hasReply()) { + mergeReply(other.getReply()); + } + if (other.hasConversation()) { + mergeConversation(other.getConversation()); + } + if (!other.relatedQuestions_.isEmpty()) { + if (relatedQuestions_.isEmpty()) { + relatedQuestions_ = other.relatedQuestions_; + bitField0_ |= 0x00000004; + } else { + ensureRelatedQuestionsIsMutable(); + relatedQuestions_.addAll(other.relatedQuestions_); + } + onChanged(); + } + if (searchResultsBuilder_ == null) { + if (!other.searchResults_.isEmpty()) { + if (searchResults_.isEmpty()) { + searchResults_ = other.searchResults_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureSearchResultsIsMutable(); + searchResults_.addAll(other.searchResults_); + } + onChanged(); + } + } else { + if (!other.searchResults_.isEmpty()) { + if (searchResultsBuilder_.isEmpty()) { + searchResultsBuilder_.dispose(); + searchResultsBuilder_ = null; + searchResults_ = other.searchResults_; + bitField0_ = (bitField0_ & ~0x00000008); + searchResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSearchResultsFieldBuilder() + : null; + } else { + searchResultsBuilder_.addAllMessages(other.searchResults_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getReplyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getConversationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult + .parser(), + extensionRegistry); + if (searchResultsBuilder_ == null) { + ensureSearchResultsIsMutable(); + searchResults_.add(m); + } else { + searchResultsBuilder_.addMessage(m); + } + break; + } // case 26 + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureRelatedQuestionsIsMutable(); + relatedQuestions_.add(s); + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.discoveryengine.v1alpha.Reply reply_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Reply, + com.google.cloud.discoveryengine.v1alpha.Reply.Builder, + com.google.cloud.discoveryengine.v1alpha.ReplyOrBuilder> + replyBuilder_; + /** + * + * + *
+     * Answer to the current query.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 1; + * + * @return Whether the reply field is set. + */ + public boolean hasReply() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Answer to the current query.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 1; + * + * @return The reply. + */ + public com.google.cloud.discoveryengine.v1alpha.Reply getReply() { + if (replyBuilder_ == null) { + return reply_ == null + ? com.google.cloud.discoveryengine.v1alpha.Reply.getDefaultInstance() + : reply_; + } else { + return replyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Answer to the current query.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 1; + */ + public Builder setReply(com.google.cloud.discoveryengine.v1alpha.Reply value) { + if (replyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + reply_ = value; + } else { + replyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Answer to the current query.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 1; + */ + public Builder setReply( + com.google.cloud.discoveryengine.v1alpha.Reply.Builder builderForValue) { + if (replyBuilder_ == null) { + reply_ = builderForValue.build(); + } else { + replyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Answer to the current query.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 1; + */ + public Builder mergeReply(com.google.cloud.discoveryengine.v1alpha.Reply value) { + if (replyBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && reply_ != null + && reply_ != com.google.cloud.discoveryengine.v1alpha.Reply.getDefaultInstance()) { + getReplyBuilder().mergeFrom(value); + } else { + reply_ = value; + } + } else { + replyBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Answer to the current query.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 1; + */ + public Builder clearReply() { + bitField0_ = (bitField0_ & ~0x00000001); + reply_ = null; + if (replyBuilder_ != null) { + replyBuilder_.dispose(); + replyBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Answer to the current query.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 1; + */ + public com.google.cloud.discoveryengine.v1alpha.Reply.Builder getReplyBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getReplyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Answer to the current query.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 1; + */ + public com.google.cloud.discoveryengine.v1alpha.ReplyOrBuilder getReplyOrBuilder() { + if (replyBuilder_ != null) { + return replyBuilder_.getMessageOrBuilder(); + } else { + return reply_ == null + ? com.google.cloud.discoveryengine.v1alpha.Reply.getDefaultInstance() + : reply_; + } + } + /** + * + * + *
+     * Answer to the current query.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Reply, + com.google.cloud.discoveryengine.v1alpha.Reply.Builder, + com.google.cloud.discoveryengine.v1alpha.ReplyOrBuilder> + getReplyFieldBuilder() { + if (replyBuilder_ == null) { + replyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Reply, + com.google.cloud.discoveryengine.v1alpha.Reply.Builder, + com.google.cloud.discoveryengine.v1alpha.ReplyOrBuilder>( + getReply(), getParentForChildren(), isClean()); + reply_ = null; + } + return replyBuilder_; + } + + private com.google.cloud.discoveryengine.v1alpha.Conversation conversation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Conversation, + com.google.cloud.discoveryengine.v1alpha.Conversation.Builder, + com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder> + conversationBuilder_; + /** + * + * + *
+     * Updated conversation including the answer.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2; + * + * @return Whether the conversation field is set. + */ + public boolean hasConversation() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Updated conversation including the answer.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2; + * + * @return The conversation. + */ + public com.google.cloud.discoveryengine.v1alpha.Conversation getConversation() { + if (conversationBuilder_ == null) { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance() + : conversation_; + } else { + return conversationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Updated conversation including the answer.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2; + */ + public Builder setConversation(com.google.cloud.discoveryengine.v1alpha.Conversation value) { + if (conversationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + conversation_ = value; + } else { + conversationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Updated conversation including the answer.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2; + */ + public Builder setConversation( + com.google.cloud.discoveryengine.v1alpha.Conversation.Builder builderForValue) { + if (conversationBuilder_ == null) { + conversation_ = builderForValue.build(); + } else { + conversationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Updated conversation including the answer.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2; + */ + public Builder mergeConversation(com.google.cloud.discoveryengine.v1alpha.Conversation value) { + if (conversationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && conversation_ != null + && conversation_ + != com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance()) { + getConversationBuilder().mergeFrom(value); + } else { + conversation_ = value; + } + } else { + conversationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Updated conversation including the answer.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2; + */ + public Builder clearConversation() { + bitField0_ = (bitField0_ & ~0x00000002); + conversation_ = null; + if (conversationBuilder_ != null) { + conversationBuilder_.dispose(); + conversationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Updated conversation including the answer.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.Conversation.Builder getConversationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getConversationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Updated conversation including the answer.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder + getConversationOrBuilder() { + if (conversationBuilder_ != null) { + return conversationBuilder_.getMessageOrBuilder(); + } else { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance() + : conversation_; + } + } + /** + * + * + *
+     * Updated conversation including the answer.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Conversation, + com.google.cloud.discoveryengine.v1alpha.Conversation.Builder, + com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder> + getConversationFieldBuilder() { + if (conversationBuilder_ == null) { + conversationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Conversation, + com.google.cloud.discoveryengine.v1alpha.Conversation.Builder, + com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder>( + getConversation(), getParentForChildren(), isClean()); + conversation_ = null; + } + return conversationBuilder_; + } + + private com.google.protobuf.LazyStringArrayList relatedQuestions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureRelatedQuestionsIsMutable() { + if (!relatedQuestions_.isModifiable()) { + relatedQuestions_ = new com.google.protobuf.LazyStringArrayList(relatedQuestions_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+     * Suggested related questions.
+     * 
+ * + * repeated string related_questions = 6; + * + * @return A list containing the relatedQuestions. + */ + public com.google.protobuf.ProtocolStringList getRelatedQuestionsList() { + relatedQuestions_.makeImmutable(); + return relatedQuestions_; + } + /** + * + * + *
+     * Suggested related questions.
+     * 
+ * + * repeated string related_questions = 6; + * + * @return The count of relatedQuestions. + */ + public int getRelatedQuestionsCount() { + return relatedQuestions_.size(); + } + /** + * + * + *
+     * Suggested related questions.
+     * 
+ * + * repeated string related_questions = 6; + * + * @param index The index of the element to return. + * @return The relatedQuestions at the given index. + */ + public java.lang.String getRelatedQuestions(int index) { + return relatedQuestions_.get(index); + } + /** + * + * + *
+     * Suggested related questions.
+     * 
+ * + * repeated string related_questions = 6; + * + * @param index The index of the value to return. + * @return The bytes of the relatedQuestions at the given index. + */ + public com.google.protobuf.ByteString getRelatedQuestionsBytes(int index) { + return relatedQuestions_.getByteString(index); + } + /** + * + * + *
+     * Suggested related questions.
+     * 
+ * + * repeated string related_questions = 6; + * + * @param index The index to set the value at. + * @param value The relatedQuestions to set. + * @return This builder for chaining. + */ + public Builder setRelatedQuestions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRelatedQuestionsIsMutable(); + relatedQuestions_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Suggested related questions.
+     * 
+ * + * repeated string related_questions = 6; + * + * @param value The relatedQuestions to add. + * @return This builder for chaining. + */ + public Builder addRelatedQuestions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRelatedQuestionsIsMutable(); + relatedQuestions_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Suggested related questions.
+     * 
+ * + * repeated string related_questions = 6; + * + * @param values The relatedQuestions to add. + * @return This builder for chaining. + */ + public Builder addAllRelatedQuestions(java.lang.Iterable values) { + ensureRelatedQuestionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, relatedQuestions_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Suggested related questions.
+     * 
+ * + * repeated string related_questions = 6; + * + * @return This builder for chaining. + */ + public Builder clearRelatedQuestions() { + relatedQuestions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Suggested related questions.
+     * 
+ * + * repeated string related_questions = 6; + * + * @param value The bytes of the relatedQuestions to add. + * @return This builder for chaining. + */ + public Builder addRelatedQuestionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRelatedQuestionsIsMutable(); + relatedQuestions_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.util.List + searchResults_ = java.util.Collections.emptyList(); + + private void ensureSearchResultsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + searchResults_ = + new java.util.ArrayList< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult>( + searchResults_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResultOrBuilder> + searchResultsBuilder_; + + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + public java.util.List + getSearchResultsList() { + if (searchResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(searchResults_); + } else { + return searchResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + public int getSearchResultsCount() { + if (searchResultsBuilder_ == null) { + return searchResults_.size(); + } else { + return searchResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult getSearchResults( + int index) { + if (searchResultsBuilder_ == null) { + return searchResults_.get(index); + } else { + return searchResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + public Builder setSearchResults( + int index, com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult value) { + if (searchResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSearchResultsIsMutable(); + searchResults_.set(index, value); + onChanged(); + } else { + searchResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + public Builder setSearchResults( + int index, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.Builder + builderForValue) { + if (searchResultsBuilder_ == null) { + ensureSearchResultsIsMutable(); + searchResults_.set(index, builderForValue.build()); + onChanged(); + } else { + searchResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + public Builder addSearchResults( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult value) { + if (searchResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSearchResultsIsMutable(); + searchResults_.add(value); + onChanged(); + } else { + searchResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + public Builder addSearchResults( + int index, com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult value) { + if (searchResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSearchResultsIsMutable(); + searchResults_.add(index, value); + onChanged(); + } else { + searchResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + public Builder addSearchResults( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.Builder + builderForValue) { + if (searchResultsBuilder_ == null) { + ensureSearchResultsIsMutable(); + searchResults_.add(builderForValue.build()); + onChanged(); + } else { + searchResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + public Builder addSearchResults( + int index, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.Builder + builderForValue) { + if (searchResultsBuilder_ == null) { + ensureSearchResultsIsMutable(); + searchResults_.add(index, builderForValue.build()); + onChanged(); + } else { + searchResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + public Builder addAllSearchResults( + java.lang.Iterable< + ? extends com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult> + values) { + if (searchResultsBuilder_ == null) { + ensureSearchResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, searchResults_); + onChanged(); + } else { + searchResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + public Builder clearSearchResults() { + if (searchResultsBuilder_ == null) { + searchResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + searchResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + public Builder removeSearchResults(int index) { + if (searchResultsBuilder_ == null) { + ensureSearchResultsIsMutable(); + searchResults_.remove(index); + onChanged(); + } else { + searchResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.Builder + getSearchResultsBuilder(int index) { + return getSearchResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResultOrBuilder + getSearchResultsOrBuilder(int index) { + if (searchResultsBuilder_ == null) { + return searchResults_.get(index); + } else { + return searchResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + public java.util.List< + ? extends com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResultOrBuilder> + getSearchResultsOrBuilderList() { + if (searchResultsBuilder_ != null) { + return searchResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(searchResults_); + } + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.Builder + addSearchResultsBuilder() { + return getSearchResultsFieldBuilder() + .addBuilder( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult + .getDefaultInstance()); + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.Builder + addSearchResultsBuilder(int index) { + return getSearchResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult + .getDefaultInstance()); + } + /** + * + * + *
+     * Search Results.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.Builder> + getSearchResultsBuilderList() { + return getSearchResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResultOrBuilder> + getSearchResultsFieldBuilder() { + if (searchResultsBuilder_ == null) { + searchResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResultOrBuilder>( + searchResults_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + searchResults_ = null; + } + return searchResultsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.ConverseConversationResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.ConverseConversationResponse) + private static final com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse(); + } + + public static com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConverseConversationResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConverseConversationResponseOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConverseConversationResponseOrBuilder.java new file mode 100644 index 000000000000..6a9ac963b214 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ConverseConversationResponseOrBuilder.java @@ -0,0 +1,211 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface ConverseConversationResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.ConverseConversationResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Answer to the current query.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 1; + * + * @return Whether the reply field is set. + */ + boolean hasReply(); + /** + * + * + *
+   * Answer to the current query.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 1; + * + * @return The reply. + */ + com.google.cloud.discoveryengine.v1alpha.Reply getReply(); + /** + * + * + *
+   * Answer to the current query.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Reply reply = 1; + */ + com.google.cloud.discoveryengine.v1alpha.ReplyOrBuilder getReplyOrBuilder(); + + /** + * + * + *
+   * Updated conversation including the answer.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2; + * + * @return Whether the conversation field is set. + */ + boolean hasConversation(); + /** + * + * + *
+   * Updated conversation including the answer.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2; + * + * @return The conversation. + */ + com.google.cloud.discoveryengine.v1alpha.Conversation getConversation(); + /** + * + * + *
+   * Updated conversation including the answer.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2; + */ + com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder getConversationOrBuilder(); + + /** + * + * + *
+   * Suggested related questions.
+   * 
+ * + * repeated string related_questions = 6; + * + * @return A list containing the relatedQuestions. + */ + java.util.List getRelatedQuestionsList(); + /** + * + * + *
+   * Suggested related questions.
+   * 
+ * + * repeated string related_questions = 6; + * + * @return The count of relatedQuestions. + */ + int getRelatedQuestionsCount(); + /** + * + * + *
+   * Suggested related questions.
+   * 
+ * + * repeated string related_questions = 6; + * + * @param index The index of the element to return. + * @return The relatedQuestions at the given index. + */ + java.lang.String getRelatedQuestions(int index); + /** + * + * + *
+   * Suggested related questions.
+   * 
+ * + * repeated string related_questions = 6; + * + * @param index The index of the value to return. + * @return The bytes of the relatedQuestions at the given index. + */ + com.google.protobuf.ByteString getRelatedQuestionsBytes(int index); + + /** + * + * + *
+   * Search Results.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + java.util.List + getSearchResultsList(); + /** + * + * + *
+   * Search Results.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult getSearchResults(int index); + /** + * + * + *
+   * Search Results.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + int getSearchResultsCount(); + /** + * + * + *
+   * Search Results.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + java.util.List< + ? extends com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResultOrBuilder> + getSearchResultsOrBuilderList(); + /** + * + * + *
+   * Search Results.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult search_results = 3; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResultOrBuilder + getSearchResultsOrBuilder(int index); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateConversationRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateConversationRequest.java new file mode 100644 index 000000000000..783ecf63cc2f --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateConversationRequest.java @@ -0,0 +1,949 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request for CreateConversation method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.CreateConversationRequest} + */ +public final class CreateConversationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.CreateConversationRequest) + CreateConversationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateConversationRequest.newBuilder() to construct. + private CreateConversationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateConversationRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateConversationRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CreateConversationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CreateConversationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest.class, + com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Full resource name of parent data store. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_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 data store. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_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 CONVERSATION_FIELD_NUMBER = 2; + private com.google.cloud.discoveryengine.v1alpha.Conversation conversation_; + /** + * + * + *
+   * Required. The conversation to create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the conversation field is set. + */ + @java.lang.Override + public boolean hasConversation() { + return conversation_ != null; + } + /** + * + * + *
+   * Required. The conversation to create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversation. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Conversation getConversation() { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance() + : conversation_; + } + /** + * + * + *
+   * Required. The conversation to create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder getConversationOrBuilder() { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance() + : conversation_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (conversation_ != null) { + output.writeMessage(2, getConversation()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (conversation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getConversation()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest other = + (com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasConversation() != other.hasConversation()) return false; + if (hasConversation()) { + if (!getConversation().equals(other.getConversation())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasConversation()) { + hash = (37 * hash) + CONVERSATION_FIELD_NUMBER; + hash = (53 * hash) + getConversation().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 CreateConversation method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.CreateConversationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.CreateConversationRequest) + com.google.cloud.discoveryengine.v1alpha.CreateConversationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CreateConversationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CreateConversationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest.class, + com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + conversation_ = null; + if (conversationBuilder_ != null) { + conversationBuilder_.dispose(); + conversationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CreateConversationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest build() { + com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest result = + new com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.conversation_ = + conversationBuilder_ == null ? conversation_ : conversationBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasConversation()) { + mergeConversation(other.getConversation()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getConversationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Full resource name of parent data store. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_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 data store. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_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 data store. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of parent data store. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of parent data store. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1alpha.Conversation conversation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Conversation, + com.google.cloud.discoveryengine.v1alpha.Conversation.Builder, + com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder> + conversationBuilder_; + /** + * + * + *
+     * Required. The conversation to create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the conversation field is set. + */ + public boolean hasConversation() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The conversation to create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversation. + */ + public com.google.cloud.discoveryengine.v1alpha.Conversation getConversation() { + if (conversationBuilder_ == null) { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance() + : conversation_; + } else { + return conversationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The conversation to create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConversation(com.google.cloud.discoveryengine.v1alpha.Conversation value) { + if (conversationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + conversation_ = value; + } else { + conversationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The conversation to create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConversation( + com.google.cloud.discoveryengine.v1alpha.Conversation.Builder builderForValue) { + if (conversationBuilder_ == null) { + conversation_ = builderForValue.build(); + } else { + conversationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The conversation to create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeConversation(com.google.cloud.discoveryengine.v1alpha.Conversation value) { + if (conversationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && conversation_ != null + && conversation_ + != com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance()) { + getConversationBuilder().mergeFrom(value); + } else { + conversation_ = value; + } + } else { + conversationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The conversation to create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearConversation() { + bitField0_ = (bitField0_ & ~0x00000002); + conversation_ = null; + if (conversationBuilder_ != null) { + conversationBuilder_.dispose(); + conversationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The conversation to create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.Conversation.Builder getConversationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getConversationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The conversation to create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder + getConversationOrBuilder() { + if (conversationBuilder_ != null) { + return conversationBuilder_.getMessageOrBuilder(); + } else { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance() + : conversation_; + } + } + /** + * + * + *
+     * Required. The conversation to create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Conversation, + com.google.cloud.discoveryengine.v1alpha.Conversation.Builder, + com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder> + getConversationFieldBuilder() { + if (conversationBuilder_ == null) { + conversationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Conversation, + com.google.cloud.discoveryengine.v1alpha.Conversation.Builder, + com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder>( + getConversation(), getParentForChildren(), isClean()); + conversation_ = null; + } + return conversationBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.CreateConversationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.CreateConversationRequest) + private static final com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateConversationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateConversationRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateConversationRequestOrBuilder.java new file mode 100644 index 000000000000..378862bfd37e --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateConversationRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface CreateConversationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.CreateConversationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of parent data store. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_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 data store. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_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 conversation to create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the conversation field is set. + */ + boolean hasConversation(); + /** + * + * + *
+   * Required. The conversation to create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversation. + */ + com.google.cloud.discoveryengine.v1alpha.Conversation getConversation(); + /** + * + * + *
+   * Required. The conversation to create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder getConversationOrBuilder(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateDocumentRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateDocumentRequest.java new file mode 100644 index 000000000000..918edfea00c8 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateDocumentRequest.java @@ -0,0 +1,1252 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/document_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request message for
+ * [DocumentService.CreateDocument][google.cloud.discoveryengine.v1alpha.DocumentService.CreateDocument]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.CreateDocumentRequest} + */ +public final class CreateDocumentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.CreateDocumentRequest) + CreateDocumentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateDocumentRequest.newBuilder() to construct. + private CreateDocumentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateDocumentRequest() { + parent_ = ""; + documentId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateDocumentRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CreateDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CreateDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest.class, + com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent resource name, such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{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 resource name, such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{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 DOCUMENT_FIELD_NUMBER = 2; + private com.google.cloud.discoveryengine.v1alpha.Document document_; + /** + * + * + *
+   * Required. The [Document][google.cloud.discoveryengine.v1alpha.Document] to
+   * create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the document field is set. + */ + @java.lang.Override + public boolean hasDocument() { + return document_ != null; + } + /** + * + * + *
+   * Required. The [Document][google.cloud.discoveryengine.v1alpha.Document] to
+   * create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The document. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Document getDocument() { + return document_ == null + ? com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance() + : document_; + } + /** + * + * + *
+   * Required. The [Document][google.cloud.discoveryengine.v1alpha.Document] to
+   * create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder getDocumentOrBuilder() { + return document_ == null + ? com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance() + : document_; + } + + public static final int DOCUMENT_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object documentId_ = ""; + /** + * + * + *
+   * Required. The ID to use for the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], which will
+   * become the final component of the
+   * [Document.name][google.cloud.discoveryengine.v1alpha.Document.name].
+   *
+   * If the caller does not have permission to create the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+   * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+   *
+   * This field must be unique among all
+   * [Document][google.cloud.discoveryengine.v1alpha.Document]s with the same
+   * [parent][google.cloud.discoveryengine.v1alpha.CreateDocumentRequest.parent].
+   * Otherwise, an `ALREADY_EXISTS` error is returned.
+   *
+   * This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+   * standard with a length limit of 63 characters. Otherwise, an
+   * `INVALID_ARGUMENT` error is returned.
+   * 
+ * + * string document_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The documentId. + */ + @java.lang.Override + public java.lang.String getDocumentId() { + java.lang.Object ref = documentId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + documentId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID to use for the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], which will
+   * become the final component of the
+   * [Document.name][google.cloud.discoveryengine.v1alpha.Document.name].
+   *
+   * If the caller does not have permission to create the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+   * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+   *
+   * This field must be unique among all
+   * [Document][google.cloud.discoveryengine.v1alpha.Document]s with the same
+   * [parent][google.cloud.discoveryengine.v1alpha.CreateDocumentRequest.parent].
+   * Otherwise, an `ALREADY_EXISTS` error is returned.
+   *
+   * This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+   * standard with a length limit of 63 characters. Otherwise, an
+   * `INVALID_ARGUMENT` error is returned.
+   * 
+ * + * string document_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for documentId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDocumentIdBytes() { + java.lang.Object ref = documentId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + documentId_ = 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 (document_ != null) { + output.writeMessage(2, getDocument()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, documentId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (document_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDocument()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, documentId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest other = + (com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasDocument() != other.hasDocument()) return false; + if (hasDocument()) { + if (!getDocument().equals(other.getDocument())) return false; + } + if (!getDocumentId().equals(other.getDocumentId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasDocument()) { + hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getDocument().hashCode(); + } + hash = (37 * hash) + DOCUMENT_ID_FIELD_NUMBER; + hash = (53 * hash) + getDocumentId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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
+   * [DocumentService.CreateDocument][google.cloud.discoveryengine.v1alpha.DocumentService.CreateDocument]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.CreateDocumentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.CreateDocumentRequest) + com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CreateDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CreateDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest.class, + com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + document_ = null; + if (documentBuilder_ != null) { + documentBuilder_.dispose(); + documentBuilder_ = null; + } + documentId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CreateDocumentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest build() { + com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest result = + new com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.document_ = documentBuilder_ == null ? document_ : documentBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.documentId_ = documentId_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasDocument()) { + mergeDocument(other.getDocument()); + } + if (!other.getDocumentId().isEmpty()) { + documentId_ = other.documentId_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + documentId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{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 resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{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 resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1alpha.Document document_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Document, + com.google.cloud.discoveryengine.v1alpha.Document.Builder, + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder> + documentBuilder_; + /** + * + * + *
+     * Required. The [Document][google.cloud.discoveryengine.v1alpha.Document] to
+     * create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the document field is set. + */ + public boolean hasDocument() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The [Document][google.cloud.discoveryengine.v1alpha.Document] to
+     * create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The document. + */ + public com.google.cloud.discoveryengine.v1alpha.Document getDocument() { + if (documentBuilder_ == null) { + return document_ == null + ? com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance() + : document_; + } else { + return documentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The [Document][google.cloud.discoveryengine.v1alpha.Document] to
+     * create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDocument(com.google.cloud.discoveryengine.v1alpha.Document value) { + if (documentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + document_ = value; + } else { + documentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The [Document][google.cloud.discoveryengine.v1alpha.Document] to
+     * create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDocument( + com.google.cloud.discoveryengine.v1alpha.Document.Builder builderForValue) { + if (documentBuilder_ == null) { + document_ = builderForValue.build(); + } else { + documentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The [Document][google.cloud.discoveryengine.v1alpha.Document] to
+     * create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDocument(com.google.cloud.discoveryengine.v1alpha.Document value) { + if (documentBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && document_ != null + && document_ + != com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance()) { + getDocumentBuilder().mergeFrom(value); + } else { + document_ = value; + } + } else { + documentBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The [Document][google.cloud.discoveryengine.v1alpha.Document] to
+     * create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDocument() { + bitField0_ = (bitField0_ & ~0x00000002); + document_ = null; + if (documentBuilder_ != null) { + documentBuilder_.dispose(); + documentBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The [Document][google.cloud.discoveryengine.v1alpha.Document] to
+     * create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.Document.Builder getDocumentBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getDocumentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The [Document][google.cloud.discoveryengine.v1alpha.Document] to
+     * create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder getDocumentOrBuilder() { + if (documentBuilder_ != null) { + return documentBuilder_.getMessageOrBuilder(); + } else { + return document_ == null + ? com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance() + : document_; + } + } + /** + * + * + *
+     * Required. The [Document][google.cloud.discoveryengine.v1alpha.Document] to
+     * create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Document, + com.google.cloud.discoveryengine.v1alpha.Document.Builder, + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder> + getDocumentFieldBuilder() { + if (documentBuilder_ == null) { + documentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Document, + com.google.cloud.discoveryengine.v1alpha.Document.Builder, + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder>( + getDocument(), getParentForChildren(), isClean()); + document_ = null; + } + return documentBuilder_; + } + + private java.lang.Object documentId_ = ""; + /** + * + * + *
+     * Required. The ID to use for the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], which will
+     * become the final component of the
+     * [Document.name][google.cloud.discoveryengine.v1alpha.Document.name].
+     *
+     * If the caller does not have permission to create the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * This field must be unique among all
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s with the same
+     * [parent][google.cloud.discoveryengine.v1alpha.CreateDocumentRequest.parent].
+     * Otherwise, an `ALREADY_EXISTS` error is returned.
+     *
+     * This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+     * standard with a length limit of 63 characters. Otherwise, an
+     * `INVALID_ARGUMENT` error is returned.
+     * 
+ * + * string document_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The documentId. + */ + public java.lang.String getDocumentId() { + java.lang.Object ref = documentId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + documentId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], which will
+     * become the final component of the
+     * [Document.name][google.cloud.discoveryengine.v1alpha.Document.name].
+     *
+     * If the caller does not have permission to create the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * This field must be unique among all
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s with the same
+     * [parent][google.cloud.discoveryengine.v1alpha.CreateDocumentRequest.parent].
+     * Otherwise, an `ALREADY_EXISTS` error is returned.
+     *
+     * This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+     * standard with a length limit of 63 characters. Otherwise, an
+     * `INVALID_ARGUMENT` error is returned.
+     * 
+ * + * string document_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for documentId. + */ + public com.google.protobuf.ByteString getDocumentIdBytes() { + java.lang.Object ref = documentId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + documentId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], which will
+     * become the final component of the
+     * [Document.name][google.cloud.discoveryengine.v1alpha.Document.name].
+     *
+     * If the caller does not have permission to create the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * This field must be unique among all
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s with the same
+     * [parent][google.cloud.discoveryengine.v1alpha.CreateDocumentRequest.parent].
+     * Otherwise, an `ALREADY_EXISTS` error is returned.
+     *
+     * This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+     * standard with a length limit of 63 characters. Otherwise, an
+     * `INVALID_ARGUMENT` error is returned.
+     * 
+ * + * string document_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The documentId to set. + * @return This builder for chaining. + */ + public Builder setDocumentId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + documentId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], which will
+     * become the final component of the
+     * [Document.name][google.cloud.discoveryengine.v1alpha.Document.name].
+     *
+     * If the caller does not have permission to create the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * This field must be unique among all
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s with the same
+     * [parent][google.cloud.discoveryengine.v1alpha.CreateDocumentRequest.parent].
+     * Otherwise, an `ALREADY_EXISTS` error is returned.
+     *
+     * This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+     * standard with a length limit of 63 characters. Otherwise, an
+     * `INVALID_ARGUMENT` error is returned.
+     * 
+ * + * string document_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDocumentId() { + documentId_ = getDefaultInstance().getDocumentId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], which will
+     * become the final component of the
+     * [Document.name][google.cloud.discoveryengine.v1alpha.Document.name].
+     *
+     * If the caller does not have permission to create the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * This field must be unique among all
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s with the same
+     * [parent][google.cloud.discoveryengine.v1alpha.CreateDocumentRequest.parent].
+     * Otherwise, an `ALREADY_EXISTS` error is returned.
+     *
+     * This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+     * standard with a length limit of 63 characters. Otherwise, an
+     * `INVALID_ARGUMENT` error is returned.
+     * 
+ * + * string document_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for documentId to set. + * @return This builder for chaining. + */ + public Builder setDocumentIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + documentId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.CreateDocumentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.CreateDocumentRequest) + private static final com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateDocumentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateDocumentRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateDocumentRequestOrBuilder.java new file mode 100644 index 000000000000..465e1dea2ef6 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateDocumentRequestOrBuilder.java @@ -0,0 +1,157 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/document_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface CreateDocumentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.CreateDocumentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name, such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name, such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{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 [Document][google.cloud.discoveryengine.v1alpha.Document] to
+   * create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the document field is set. + */ + boolean hasDocument(); + /** + * + * + *
+   * Required. The [Document][google.cloud.discoveryengine.v1alpha.Document] to
+   * create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The document. + */ + com.google.cloud.discoveryengine.v1alpha.Document getDocument(); + /** + * + * + *
+   * Required. The [Document][google.cloud.discoveryengine.v1alpha.Document] to
+   * create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder getDocumentOrBuilder(); + + /** + * + * + *
+   * Required. The ID to use for the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], which will
+   * become the final component of the
+   * [Document.name][google.cloud.discoveryengine.v1alpha.Document.name].
+   *
+   * If the caller does not have permission to create the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+   * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+   *
+   * This field must be unique among all
+   * [Document][google.cloud.discoveryengine.v1alpha.Document]s with the same
+   * [parent][google.cloud.discoveryengine.v1alpha.CreateDocumentRequest.parent].
+   * Otherwise, an `ALREADY_EXISTS` error is returned.
+   *
+   * This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+   * standard with a length limit of 63 characters. Otherwise, an
+   * `INVALID_ARGUMENT` error is returned.
+   * 
+ * + * string document_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The documentId. + */ + java.lang.String getDocumentId(); + /** + * + * + *
+   * Required. The ID to use for the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], which will
+   * become the final component of the
+   * [Document.name][google.cloud.discoveryengine.v1alpha.Document.name].
+   *
+   * If the caller does not have permission to create the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+   * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+   *
+   * This field must be unique among all
+   * [Document][google.cloud.discoveryengine.v1alpha.Document]s with the same
+   * [parent][google.cloud.discoveryengine.v1alpha.CreateDocumentRequest.parent].
+   * Otherwise, an `ALREADY_EXISTS` error is returned.
+   *
+   * This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+   * standard with a length limit of 63 characters. Otherwise, an
+   * `INVALID_ARGUMENT` error is returned.
+   * 
+ * + * string document_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for documentId. + */ + com.google.protobuf.ByteString getDocumentIdBytes(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateSchemaMetadata.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateSchemaMetadata.java new file mode 100644 index 000000000000..0cbbab9415cc --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateSchemaMetadata.java @@ -0,0 +1,978 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Metadata for Create Schema LRO.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata} + */ +public final class CreateSchemaMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata) + CreateSchemaMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateSchemaMetadata.newBuilder() to construct. + private CreateSchemaMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSchemaMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSchemaMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CreateSchemaMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CreateSchemaMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata.class, + com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata.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 createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + 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 updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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()); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata other = + (com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata) 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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 Create Schema LRO.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata) + com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CreateSchemaMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CreateSchemaMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata.class, + com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CreateSchemaMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata build() { + com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata buildPartial() { + com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata result = + new com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + 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 ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * 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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + 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(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000001); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000001; + 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 ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * 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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + 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(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + 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 (((bitField0_ & 0x00000002) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + 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() { + bitField0_ = (bitField0_ & ~0x00000002); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + 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() { + bitField0_ |= 0x00000002; + 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.discoveryengine.v1alpha.CreateSchemaMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata) + private static final com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata(); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSchemaMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateSchemaMetadataOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateSchemaMetadataOrBuilder.java new file mode 100644 index 000000000000..3fa1627e1ffe --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateSchemaMetadataOrBuilder.java @@ -0,0 +1,98 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface CreateSchemaMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata) + 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/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateSchemaRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateSchemaRequest.java new file mode 100644 index 000000000000..5e28ad49e04f --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateSchemaRequest.java @@ -0,0 +1,1186 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request message for
+ * [SchemaService.CreateSchema][google.cloud.discoveryengine.v1alpha.SchemaService.CreateSchema]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.CreateSchemaRequest} + */ +public final class CreateSchemaRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.CreateSchemaRequest) + CreateSchemaRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateSchemaRequest.newBuilder() to construct. + private CreateSchemaRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSchemaRequest() { + parent_ = ""; + schemaId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSchemaRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CreateSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CreateSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest.class, + com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent data store resource name, in the format of
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+   * 
+ * + * + * 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 data store resource name, in the format of
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+   * 
+ * + * + * 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 SCHEMA_FIELD_NUMBER = 2; + private com.google.cloud.discoveryengine.v1alpha.Schema schema_; + /** + * + * + *
+   * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+   * create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the schema field is set. + */ + @java.lang.Override + public boolean hasSchema() { + return schema_ != null; + } + /** + * + * + *
+   * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+   * create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The schema. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Schema getSchema() { + return schema_ == null + ? com.google.cloud.discoveryengine.v1alpha.Schema.getDefaultInstance() + : schema_; + } + /** + * + * + *
+   * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+   * create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SchemaOrBuilder getSchemaOrBuilder() { + return schema_ == null + ? com.google.cloud.discoveryengine.v1alpha.Schema.getDefaultInstance() + : schema_; + } + + public static final int SCHEMA_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object schemaId_ = ""; + /** + * + * + *
+   * Required. The ID to use for the
+   * [Schema][google.cloud.discoveryengine.v1alpha.Schema], which will become
+   * the final component of the
+   * [Schema.name][google.cloud.discoveryengine.v1alpha.Schema.name].
+   *
+   * This field should conform to
+   * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length
+   * limit of 63 characters.
+   * 
+ * + * string schema_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The schemaId. + */ + @java.lang.Override + public java.lang.String getSchemaId() { + java.lang.Object ref = schemaId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + schemaId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID to use for the
+   * [Schema][google.cloud.discoveryengine.v1alpha.Schema], which will become
+   * the final component of the
+   * [Schema.name][google.cloud.discoveryengine.v1alpha.Schema.name].
+   *
+   * This field should conform to
+   * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length
+   * limit of 63 characters.
+   * 
+ * + * string schema_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for schemaId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSchemaIdBytes() { + java.lang.Object ref = schemaId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schemaId_ = 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 (schema_ != null) { + output.writeMessage(2, getSchema()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(schemaId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, schemaId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (schema_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSchema()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(schemaId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, schemaId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest other = + (com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasSchema() != other.hasSchema()) return false; + if (hasSchema()) { + if (!getSchema().equals(other.getSchema())) return false; + } + if (!getSchemaId().equals(other.getSchemaId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasSchema()) { + hash = (37 * hash) + SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getSchema().hashCode(); + } + hash = (37 * hash) + SCHEMA_ID_FIELD_NUMBER; + hash = (53 * hash) + getSchemaId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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
+   * [SchemaService.CreateSchema][google.cloud.discoveryengine.v1alpha.SchemaService.CreateSchema]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.CreateSchemaRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.CreateSchemaRequest) + com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CreateSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CreateSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest.class, + com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + schema_ = null; + if (schemaBuilder_ != null) { + schemaBuilder_.dispose(); + schemaBuilder_ = null; + } + schemaId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_CreateSchemaRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest build() { + com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest result = + new com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.schema_ = schemaBuilder_ == null ? schema_ : schemaBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.schemaId_ = schemaId_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasSchema()) { + mergeSchema(other.getSchema()); + } + if (!other.getSchemaId().isEmpty()) { + schemaId_ = other.schemaId_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getSchemaFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + schemaId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent data store resource name, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+     * 
+ * + * + * 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 data store resource name, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+     * 
+ * + * + * 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 data store resource name, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent data store resource name, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent data store resource name, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1alpha.Schema schema_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Schema, + com.google.cloud.discoveryengine.v1alpha.Schema.Builder, + com.google.cloud.discoveryengine.v1alpha.SchemaOrBuilder> + schemaBuilder_; + /** + * + * + *
+     * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+     * create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the schema field is set. + */ + public boolean hasSchema() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+     * create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The schema. + */ + public com.google.cloud.discoveryengine.v1alpha.Schema getSchema() { + if (schemaBuilder_ == null) { + return schema_ == null + ? com.google.cloud.discoveryengine.v1alpha.Schema.getDefaultInstance() + : schema_; + } else { + return schemaBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+     * create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSchema(com.google.cloud.discoveryengine.v1alpha.Schema value) { + if (schemaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schema_ = value; + } else { + schemaBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+     * create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSchema( + com.google.cloud.discoveryengine.v1alpha.Schema.Builder builderForValue) { + if (schemaBuilder_ == null) { + schema_ = builderForValue.build(); + } else { + schemaBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+     * create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSchema(com.google.cloud.discoveryengine.v1alpha.Schema value) { + if (schemaBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && schema_ != null + && schema_ != com.google.cloud.discoveryengine.v1alpha.Schema.getDefaultInstance()) { + getSchemaBuilder().mergeFrom(value); + } else { + schema_ = value; + } + } else { + schemaBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+     * create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSchema() { + bitField0_ = (bitField0_ & ~0x00000002); + schema_ = null; + if (schemaBuilder_ != null) { + schemaBuilder_.dispose(); + schemaBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+     * create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.Schema.Builder getSchemaBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getSchemaFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+     * create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SchemaOrBuilder getSchemaOrBuilder() { + if (schemaBuilder_ != null) { + return schemaBuilder_.getMessageOrBuilder(); + } else { + return schema_ == null + ? com.google.cloud.discoveryengine.v1alpha.Schema.getDefaultInstance() + : schema_; + } + } + /** + * + * + *
+     * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+     * create.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Schema, + com.google.cloud.discoveryengine.v1alpha.Schema.Builder, + com.google.cloud.discoveryengine.v1alpha.SchemaOrBuilder> + getSchemaFieldBuilder() { + if (schemaBuilder_ == null) { + schemaBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Schema, + com.google.cloud.discoveryengine.v1alpha.Schema.Builder, + com.google.cloud.discoveryengine.v1alpha.SchemaOrBuilder>( + getSchema(), getParentForChildren(), isClean()); + schema_ = null; + } + return schemaBuilder_; + } + + private java.lang.Object schemaId_ = ""; + /** + * + * + *
+     * Required. The ID to use for the
+     * [Schema][google.cloud.discoveryengine.v1alpha.Schema], which will become
+     * the final component of the
+     * [Schema.name][google.cloud.discoveryengine.v1alpha.Schema.name].
+     *
+     * This field should conform to
+     * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length
+     * limit of 63 characters.
+     * 
+ * + * string schema_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The schemaId. + */ + public java.lang.String getSchemaId() { + java.lang.Object ref = schemaId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + schemaId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the
+     * [Schema][google.cloud.discoveryengine.v1alpha.Schema], which will become
+     * the final component of the
+     * [Schema.name][google.cloud.discoveryengine.v1alpha.Schema.name].
+     *
+     * This field should conform to
+     * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length
+     * limit of 63 characters.
+     * 
+ * + * string schema_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for schemaId. + */ + public com.google.protobuf.ByteString getSchemaIdBytes() { + java.lang.Object ref = schemaId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schemaId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the
+     * [Schema][google.cloud.discoveryengine.v1alpha.Schema], which will become
+     * the final component of the
+     * [Schema.name][google.cloud.discoveryengine.v1alpha.Schema.name].
+     *
+     * This field should conform to
+     * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length
+     * limit of 63 characters.
+     * 
+ * + * string schema_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The schemaId to set. + * @return This builder for chaining. + */ + public Builder setSchemaId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + schemaId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the
+     * [Schema][google.cloud.discoveryengine.v1alpha.Schema], which will become
+     * the final component of the
+     * [Schema.name][google.cloud.discoveryengine.v1alpha.Schema.name].
+     *
+     * This field should conform to
+     * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length
+     * limit of 63 characters.
+     * 
+ * + * string schema_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearSchemaId() { + schemaId_ = getDefaultInstance().getSchemaId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the
+     * [Schema][google.cloud.discoveryengine.v1alpha.Schema], which will become
+     * the final component of the
+     * [Schema.name][google.cloud.discoveryengine.v1alpha.Schema.name].
+     *
+     * This field should conform to
+     * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length
+     * limit of 63 characters.
+     * 
+ * + * string schema_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for schemaId to set. + * @return This builder for chaining. + */ + public Builder setSchemaIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + schemaId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.CreateSchemaRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.CreateSchemaRequest) + private static final com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSchemaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateSchemaRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateSchemaRequestOrBuilder.java new file mode 100644 index 000000000000..cdfd1b57b97e --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CreateSchemaRequestOrBuilder.java @@ -0,0 +1,139 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface CreateSchemaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.CreateSchemaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent data store resource name, in the format of
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent data store resource name, in the format of
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+   * create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the schema field is set. + */ + boolean hasSchema(); + /** + * + * + *
+   * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+   * create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The schema. + */ + com.google.cloud.discoveryengine.v1alpha.Schema getSchema(); + /** + * + * + *
+   * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+   * create.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.discoveryengine.v1alpha.SchemaOrBuilder getSchemaOrBuilder(); + + /** + * + * + *
+   * Required. The ID to use for the
+   * [Schema][google.cloud.discoveryengine.v1alpha.Schema], which will become
+   * the final component of the
+   * [Schema.name][google.cloud.discoveryengine.v1alpha.Schema.name].
+   *
+   * This field should conform to
+   * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length
+   * limit of 63 characters.
+   * 
+ * + * string schema_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The schemaId. + */ + java.lang.String getSchemaId(); + /** + * + * + *
+   * Required. The ID to use for the
+   * [Schema][google.cloud.discoveryengine.v1alpha.Schema], which will become
+   * the final component of the
+   * [Schema.name][google.cloud.discoveryengine.v1alpha.Schema.name].
+   *
+   * This field should conform to
+   * [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length
+   * limit of 63 characters.
+   * 
+ * + * string schema_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for schemaId. + */ + com.google.protobuf.ByteString getSchemaIdBytes(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CustomAttribute.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CustomAttribute.java new file mode 100644 index 000000000000..7221918765e0 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CustomAttribute.java @@ -0,0 +1,1164 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/common.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * A custom attribute that is not explicitly modeled in a resource, e.g.
+ * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent].
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.CustomAttribute} + */ +public final class CustomAttribute extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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.emptyList(); + numbers_ = emptyDoubleList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CustomAttribute(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.CommonProto + .internal_static_google_cloud_discoveryengine_v1alpha_CustomAttribute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.CommonProto + .internal_static_google_cloud_discoveryengine_v1alpha_CustomAttribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.CustomAttribute.class, + com.google.cloud.discoveryengine.v1alpha.CustomAttribute.Builder.class); + } + + public static final int TEXT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList text_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * 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
+   * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+   * or
+   * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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
+   * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+   * or
+   * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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
+   * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+   * or
+   * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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
+   * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+   * or
+   * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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; + + @SuppressWarnings("serial") + 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
+   * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+   * or
+   * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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
+   * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+   * or
+   * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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
+   * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+   * or
+   * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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; + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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)); + } + getUnknownFields().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; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.CustomAttribute)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.CustomAttribute other = + (com.google.cloud.discoveryengine.v1alpha.CustomAttribute) obj; + + if (!getTextList().equals(other.getTextList())) return false; + if (!getNumbersList().equals(other.getNumbersList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (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(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.CustomAttribute parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.CustomAttribute parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.CustomAttribute parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.CustomAttribute parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.CustomAttribute parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.CustomAttribute parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.CustomAttribute parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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 a resource, e.g.
+   * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent].
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.CustomAttribute} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.CustomAttribute) + com.google.cloud.discoveryengine.v1alpha.CustomAttributeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.CommonProto + .internal_static_google_cloud_discoveryengine_v1alpha_CustomAttribute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.CommonProto + .internal_static_google_cloud_discoveryengine_v1alpha_CustomAttribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.CustomAttribute.class, + com.google.cloud.discoveryengine.v1alpha.CustomAttribute.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.CustomAttribute.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + text_ = com.google.protobuf.LazyStringArrayList.emptyList(); + numbers_ = emptyDoubleList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.CommonProto + .internal_static_google_cloud_discoveryengine_v1alpha_CustomAttribute_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CustomAttribute getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.CustomAttribute.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CustomAttribute build() { + com.google.cloud.discoveryengine.v1alpha.CustomAttribute result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CustomAttribute buildPartial() { + com.google.cloud.discoveryengine.v1alpha.CustomAttribute result = + new com.google.cloud.discoveryengine.v1alpha.CustomAttribute(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.CustomAttribute result) { + if (((bitField0_ & 0x00000002) != 0)) { + numbers_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.numbers_ = numbers_; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.CustomAttribute result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + text_.makeImmutable(); + result.text_ = text_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.CustomAttribute) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.CustomAttribute) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.CustomAttribute other) { + if (other == com.google.cloud.discoveryengine.v1alpha.CustomAttribute.getDefaultInstance()) + return this; + if (!other.text_.isEmpty()) { + if (text_.isEmpty()) { + text_ = other.text_; + 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(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureTextIsMutable(); + text_.add(s); + break; + } // case 10 + case 17: + { + double v = input.readDouble(); + ensureNumbersIsMutable(); + numbers_.addDouble(v); + break; + } // case 17 + case 18: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureNumbersIsMutable(); + while (input.getBytesUntilLimit() > 0) { + numbers_.addDouble(input.readDouble()); + } + input.popLimit(limit); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList text_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureTextIsMutable() { + if (!text_.isModifiable()) { + 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
+     * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+     * or
+     * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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() { + text_.makeImmutable(); + 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
+     * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+     * or
+     * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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
+     * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+     * or
+     * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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
+     * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+     * or
+     * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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
+     * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+     * or
+     * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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); + 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
+     * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+     * or
+     * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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); + 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
+     * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+     * or
+     * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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_); + 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
+     * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+     * or
+     * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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.emptyList(); + 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
+     * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+     * or
+     * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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); + bitField0_ |= 0x00000001; + 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
+     * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+     * or
+     * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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
+     * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+     * or
+     * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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
+     * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+     * or
+     * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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
+     * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+     * or
+     * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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
+     * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+     * or
+     * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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
+     * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+     * or
+     * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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
+     * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+     * or
+     * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.CustomAttribute) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.CustomAttribute) + private static final com.google.cloud.discoveryengine.v1alpha.CustomAttribute DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.CustomAttribute(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CustomAttribute getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CustomAttributeOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CustomAttributeOrBuilder.java new file mode 100644 index 000000000000..ecc768d396cc --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/CustomAttributeOrBuilder.java @@ -0,0 +1,175 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/common.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface CustomAttributeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.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
+   * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+   * or
+   * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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
+   * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+   * or
+   * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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
+   * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+   * or
+   * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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
+   * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+   * or
+   * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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
+   * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+   * or
+   * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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
+   * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+   * or
+   * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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
+   * [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text]
+   * or
+   * [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DataStoreName.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DataStoreName.java new file mode 100644 index 000000000000..370c86ee6f6f --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DataStoreName.java @@ -0,0 +1,371 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +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 DataStoreName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_DATA_STORE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/dataStores/{data_store}"); + private static final PathTemplate PROJECT_LOCATION_COLLECTION_DATA_STORE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String dataStore; + private final String collection; + + @Deprecated + protected DataStoreName() { + project = null; + location = null; + dataStore = null; + collection = null; + } + + private DataStoreName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + dataStore = Preconditions.checkNotNull(builder.getDataStore()); + collection = null; + pathTemplate = PROJECT_LOCATION_DATA_STORE; + } + + private DataStoreName(ProjectLocationCollectionDataStoreBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + collection = Preconditions.checkNotNull(builder.getCollection()); + dataStore = Preconditions.checkNotNull(builder.getDataStore()); + pathTemplate = PROJECT_LOCATION_COLLECTION_DATA_STORE; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataStore() { + return dataStore; + } + + public String getCollection() { + return collection; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectLocationDataStoreBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static ProjectLocationCollectionDataStoreBuilder + newProjectLocationCollectionDataStoreBuilder() { + return new ProjectLocationCollectionDataStoreBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static DataStoreName of(String project, String location, String dataStore) { + return newBuilder().setProject(project).setLocation(location).setDataStore(dataStore).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static DataStoreName ofProjectLocationDataStoreName( + String project, String location, String dataStore) { + return newBuilder().setProject(project).setLocation(location).setDataStore(dataStore).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static DataStoreName ofProjectLocationCollectionDataStoreName( + String project, String location, String collection, String dataStore) { + return newProjectLocationCollectionDataStoreBuilder() + .setProject(project) + .setLocation(location) + .setCollection(collection) + .setDataStore(dataStore) + .build(); + } + + public static String format(String project, String location, String dataStore) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationDataStoreName( + String project, String location, String dataStore) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationCollectionDataStoreName( + String project, String location, String collection, String dataStore) { + return newProjectLocationCollectionDataStoreBuilder() + .setProject(project) + .setLocation(location) + .setCollection(collection) + .setDataStore(dataStore) + .build() + .toString(); + } + + public static DataStoreName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_DATA_STORE.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_DATA_STORE.match(formattedString); + return ofProjectLocationDataStoreName( + matchMap.get("project"), matchMap.get("location"), matchMap.get("data_store")); + } else if (PROJECT_LOCATION_COLLECTION_DATA_STORE.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_COLLECTION_DATA_STORE.match(formattedString); + return ofProjectLocationCollectionDataStoreName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("collection"), + matchMap.get("data_store")); + } + throw new ValidationException("DataStoreName.parse: formattedString not in valid format"); + } + + 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 (DataStoreName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_DATA_STORE.matches(formattedString) + || PROJECT_LOCATION_COLLECTION_DATA_STORE.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 (dataStore != null) { + fieldMapBuilder.put("data_store", dataStore); + } + if (collection != null) { + fieldMapBuilder.put("collection", collection); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + DataStoreName that = ((DataStoreName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.dataStore, that.dataStore) + && Objects.equals(this.collection, that.collection); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(dataStore); + h *= 1000003; + h ^= Objects.hashCode(collection); + return h; + } + + /** Builder for projects/{project}/locations/{location}/dataStores/{data_store}. */ + public static class Builder { + private String project; + private String location; + private String dataStore; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataStore() { + return dataStore; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setDataStore(String dataStore) { + this.dataStore = dataStore; + return this; + } + + private Builder(DataStoreName dataStoreName) { + Preconditions.checkArgument( + Objects.equals(dataStoreName.pathTemplate, PROJECT_LOCATION_DATA_STORE), + "toBuilder is only supported when DataStoreName has the pattern of projects/{project}/locations/{location}/dataStores/{data_store}"); + this.project = dataStoreName.project; + this.location = dataStoreName.location; + this.dataStore = dataStoreName.dataStore; + } + + public DataStoreName build() { + return new DataStoreName(this); + } + } + + /** + * Builder for + * projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}. + */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class ProjectLocationCollectionDataStoreBuilder { + private String project; + private String location; + private String collection; + private String dataStore; + + protected ProjectLocationCollectionDataStoreBuilder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCollection() { + return collection; + } + + public String getDataStore() { + return dataStore; + } + + public ProjectLocationCollectionDataStoreBuilder setProject(String project) { + this.project = project; + return this; + } + + public ProjectLocationCollectionDataStoreBuilder setLocation(String location) { + this.location = location; + return this; + } + + public ProjectLocationCollectionDataStoreBuilder setCollection(String collection) { + this.collection = collection; + return this; + } + + public ProjectLocationCollectionDataStoreBuilder setDataStore(String dataStore) { + this.dataStore = dataStore; + return this; + } + + public DataStoreName build() { + return new DataStoreName(this); + } + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteConversationRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteConversationRequest.java new file mode 100644 index 000000000000..6626da340a2f --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteConversationRequest.java @@ -0,0 +1,657 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request for DeleteConversation method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.DeleteConversationRequest} + */ +public final class DeleteConversationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.DeleteConversationRequest) + DeleteConversationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteConversationRequest.newBuilder() to construct. + private DeleteConversationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteConversationRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteConversationRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_DeleteConversationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_DeleteConversationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest.class, + com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The resource name of the Conversation to delete. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_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 Conversation to delete. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_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_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest other = + (com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 DeleteConversation method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.DeleteConversationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.DeleteConversationRequest) + com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_DeleteConversationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_DeleteConversationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest.class, + com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_DeleteConversationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest build() { + com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest result = + new com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the Conversation to delete. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_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 Conversation to delete. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_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 Conversation to delete. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Conversation to delete. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Conversation to delete. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_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; + 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.discoveryengine.v1alpha.DeleteConversationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.DeleteConversationRequest) + private static final com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteConversationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteConversationRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteConversationRequestOrBuilder.java new file mode 100644 index 000000000000..0ef756e694ae --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteConversationRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface DeleteConversationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.DeleteConversationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Conversation to delete. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_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 Conversation to delete. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteDocumentRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteDocumentRequest.java new file mode 100644 index 000000000000..e37428300a1f --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteDocumentRequest.java @@ -0,0 +1,712 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/document_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request message for
+ * [DocumentService.DeleteDocument][google.cloud.discoveryengine.v1alpha.DocumentService.DeleteDocument]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest} + */ +public final class DeleteDocumentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest) + DeleteDocumentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteDocumentRequest.newBuilder() to construct. + private DeleteDocumentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteDocumentRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteDocumentRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_DeleteDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_DeleteDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest.class, + com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Full resource name of
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
+   *
+   * If the caller does not have permission to delete the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+   * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+   *
+   * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to delete
+   * 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
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
+   *
+   * If the caller does not have permission to delete the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+   * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+   *
+   * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to delete
+   * 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_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest other = + (com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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
+   * [DocumentService.DeleteDocument][google.cloud.discoveryengine.v1alpha.DocumentService.DeleteDocument]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest) + com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_DeleteDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_DeleteDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest.class, + com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_DeleteDocumentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest build() { + com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest result = + new com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Full resource name of
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
+     *
+     * If the caller does not have permission to delete the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to delete
+     * 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
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
+     *
+     * If the caller does not have permission to delete the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to delete
+     * 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
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
+     *
+     * If the caller does not have permission to delete the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to delete
+     * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
+     *
+     * If the caller does not have permission to delete the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to delete
+     * 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(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
+     *
+     * If the caller does not have permission to delete the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to delete
+     * 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; + 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.discoveryengine.v1alpha.DeleteDocumentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest) + private static final com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteDocumentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteDocumentRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteDocumentRequestOrBuilder.java new file mode 100644 index 000000000000..bd79b8122d9e --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteDocumentRequestOrBuilder.java @@ -0,0 +1,72 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/document_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface DeleteDocumentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
+   *
+   * If the caller does not have permission to delete the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+   * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+   *
+   * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to delete
+   * 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
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
+   *
+   * If the caller does not have permission to delete the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+   * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+   *
+   * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to delete
+   * 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/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteSchemaMetadata.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteSchemaMetadata.java new file mode 100644 index 000000000000..1d01ac153828 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteSchemaMetadata.java @@ -0,0 +1,978 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Metadata for DeleteSchema LRO.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata} + */ +public final class DeleteSchemaMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata) + DeleteSchemaMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteSchemaMetadata.newBuilder() to construct. + private DeleteSchemaMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteSchemaMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteSchemaMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_DeleteSchemaMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_DeleteSchemaMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata.class, + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata.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 createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + 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 updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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()); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata other = + (com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata) 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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 DeleteSchema LRO.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata) + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_DeleteSchemaMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_DeleteSchemaMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata.class, + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_DeleteSchemaMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata build() { + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata buildPartial() { + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata result = + new com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + 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 ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * 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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + 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(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000001); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000001; + 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 ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * 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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + 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(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + 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 (((bitField0_ & 0x00000002) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + 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() { + bitField0_ = (bitField0_ & ~0x00000002); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + 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() { + bitField0_ |= 0x00000002; + 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.discoveryengine.v1alpha.DeleteSchemaMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata) + private static final com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata(); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteSchemaMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteSchemaMetadataOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteSchemaMetadataOrBuilder.java new file mode 100644 index 000000000000..b58f8f59881e --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteSchemaMetadataOrBuilder.java @@ -0,0 +1,98 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface DeleteSchemaMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata) + 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/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteSchemaRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteSchemaRequest.java new file mode 100644 index 000000000000..3003481db580 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteSchemaRequest.java @@ -0,0 +1,654 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request message for
+ * [SchemaService.DeleteSchema][google.cloud.discoveryengine.v1alpha.SchemaService.DeleteSchema]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest} + */ +public final class DeleteSchemaRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest) + DeleteSchemaRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteSchemaRequest.newBuilder() to construct. + private DeleteSchemaRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteSchemaRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteSchemaRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_DeleteSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_DeleteSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest.class, + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The full resource name of the schema, in the format of
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+   * 
+ * + * + * 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 full resource name of the schema, in the format of
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+   * 
+ * + * + * 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_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest other = + (com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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
+   * [SchemaService.DeleteSchema][google.cloud.discoveryengine.v1alpha.SchemaService.DeleteSchema]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest) + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_DeleteSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_DeleteSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest.class, + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_DeleteSchemaRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest build() { + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest result = + new com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The full resource name of the schema, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+     * 
+ * + * + * 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 full resource name of the schema, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+     * 
+ * + * + * 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 full resource name of the schema, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The full resource name of the schema, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The full resource name of the schema, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+     * 
+ * + * + * 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; + 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.discoveryengine.v1alpha.DeleteSchemaRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest) + private static final com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteSchemaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteSchemaRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteSchemaRequestOrBuilder.java new file mode 100644 index 000000000000..e7ef7253a262 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DeleteSchemaRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface DeleteSchemaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The full resource name of the schema, in the format of
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The full resource name of the schema, in the format of
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/Document.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/Document.java new file mode 100644 index 000000000000..686f8aa8ac68 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/Document.java @@ -0,0 +1,3806 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/document.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Document captures all raw metadata information of items to be recommended or
+ * searched.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.Document} + */ +public final class Document extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.Document) + DocumentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Document.newBuilder() to construct. + private Document(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Document() { + name_ = ""; + id_ = ""; + schemaId_ = ""; + parentDocumentId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Document(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.DocumentProto + .internal_static_google_cloud_discoveryengine_v1alpha_Document_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.DocumentProto + .internal_static_google_cloud_discoveryengine_v1alpha_Document_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.Document.class, + com.google.cloud.discoveryengine.v1alpha.Document.Builder.class); + } + + public interface ContentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.Document.Content) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The content represented as a stream of bytes. The maximum length is
+     * 1,000,000 bytes (1 MB / ~0.95 MiB).
+     *
+     * Note: As with all `bytes` fields, this field is represented as pure
+     * binary in Protocol Buffers and base64-encoded string in JSON. For
+     * example, `abc123!?$*&()'-=@~` should be represented as
+     * `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See
+     * https://developers.google.com/protocol-buffers/docs/proto3#json.
+     * 
+ * + * bytes raw_bytes = 2; + * + * @return Whether the rawBytes field is set. + */ + boolean hasRawBytes(); + /** + * + * + *
+     * The content represented as a stream of bytes. The maximum length is
+     * 1,000,000 bytes (1 MB / ~0.95 MiB).
+     *
+     * Note: As with all `bytes` fields, this field is represented as pure
+     * binary in Protocol Buffers and base64-encoded string in JSON. For
+     * example, `abc123!?$*&()'-=@~` should be represented as
+     * `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See
+     * https://developers.google.com/protocol-buffers/docs/proto3#json.
+     * 
+ * + * bytes raw_bytes = 2; + * + * @return The rawBytes. + */ + com.google.protobuf.ByteString getRawBytes(); + + /** + * + * + *
+     * The URI of the content. Only Cloud Storage URIs (e.g.
+     * `gs://bucket-name/path/to/file`) are supported. The maximum file size
+     * is 100 MB.
+     * 
+ * + * string uri = 3; + * + * @return Whether the uri field is set. + */ + boolean hasUri(); + /** + * + * + *
+     * The URI of the content. Only Cloud Storage URIs (e.g.
+     * `gs://bucket-name/path/to/file`) are supported. The maximum file size
+     * is 100 MB.
+     * 
+ * + * string uri = 3; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+     * The URI of the content. Only Cloud Storage URIs (e.g.
+     * `gs://bucket-name/path/to/file`) are supported. The maximum file size
+     * is 100 MB.
+     * 
+ * + * string uri = 3; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+     * The MIME type of the content. Supported types:
+     *
+     * * `application/pdf` (PDF, only native PDFs are supported for now)
+     * * `text/html` (HTML)
+     * * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX)
+     * * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX)
+     * * `text/plain` (TXT)
+     *
+     * See https://www.iana.org/assignments/media-types/media-types.xhtml.
+     * 
+ * + * string mime_type = 1; + * + * @return The mimeType. + */ + java.lang.String getMimeType(); + /** + * + * + *
+     * The MIME type of the content. Supported types:
+     *
+     * * `application/pdf` (PDF, only native PDFs are supported for now)
+     * * `text/html` (HTML)
+     * * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX)
+     * * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX)
+     * * `text/plain` (TXT)
+     *
+     * See https://www.iana.org/assignments/media-types/media-types.xhtml.
+     * 
+ * + * string mime_type = 1; + * + * @return The bytes for mimeType. + */ + com.google.protobuf.ByteString getMimeTypeBytes(); + + com.google.cloud.discoveryengine.v1alpha.Document.Content.ContentCase getContentCase(); + } + /** + * + * + *
+   * Unstructured data linked to this document.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.Document.Content} + */ + public static final class Content extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.Document.Content) + ContentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Content.newBuilder() to construct. + private Content(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Content() { + mimeType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Content(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.DocumentProto + .internal_static_google_cloud_discoveryengine_v1alpha_Document_Content_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.DocumentProto + .internal_static_google_cloud_discoveryengine_v1alpha_Document_Content_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.Document.Content.class, + com.google.cloud.discoveryengine.v1alpha.Document.Content.Builder.class); + } + + private int contentCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object content_; + + public enum ContentCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + RAW_BYTES(2), + URI(3), + CONTENT_NOT_SET(0); + private final int value; + + private ContentCase(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 ContentCase valueOf(int value) { + return forNumber(value); + } + + public static ContentCase forNumber(int value) { + switch (value) { + case 2: + return RAW_BYTES; + case 3: + return URI; + case 0: + return CONTENT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ContentCase getContentCase() { + return ContentCase.forNumber(contentCase_); + } + + public static final int RAW_BYTES_FIELD_NUMBER = 2; + /** + * + * + *
+     * The content represented as a stream of bytes. The maximum length is
+     * 1,000,000 bytes (1 MB / ~0.95 MiB).
+     *
+     * Note: As with all `bytes` fields, this field is represented as pure
+     * binary in Protocol Buffers and base64-encoded string in JSON. For
+     * example, `abc123!?$*&()'-=@~` should be represented as
+     * `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See
+     * https://developers.google.com/protocol-buffers/docs/proto3#json.
+     * 
+ * + * bytes raw_bytes = 2; + * + * @return Whether the rawBytes field is set. + */ + @java.lang.Override + public boolean hasRawBytes() { + return contentCase_ == 2; + } + /** + * + * + *
+     * The content represented as a stream of bytes. The maximum length is
+     * 1,000,000 bytes (1 MB / ~0.95 MiB).
+     *
+     * Note: As with all `bytes` fields, this field is represented as pure
+     * binary in Protocol Buffers and base64-encoded string in JSON. For
+     * example, `abc123!?$*&()'-=@~` should be represented as
+     * `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See
+     * https://developers.google.com/protocol-buffers/docs/proto3#json.
+     * 
+ * + * bytes raw_bytes = 2; + * + * @return The rawBytes. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRawBytes() { + if (contentCase_ == 2) { + return (com.google.protobuf.ByteString) content_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int URI_FIELD_NUMBER = 3; + /** + * + * + *
+     * The URI of the content. Only Cloud Storage URIs (e.g.
+     * `gs://bucket-name/path/to/file`) are supported. The maximum file size
+     * is 100 MB.
+     * 
+ * + * string uri = 3; + * + * @return Whether the uri field is set. + */ + public boolean hasUri() { + return contentCase_ == 3; + } + /** + * + * + *
+     * The URI of the content. Only Cloud Storage URIs (e.g.
+     * `gs://bucket-name/path/to/file`) are supported. The maximum file size
+     * is 100 MB.
+     * 
+ * + * string uri = 3; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = ""; + if (contentCase_ == 3) { + ref = content_; + } + if (ref instanceof java.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 (contentCase_ == 3) { + content_ = s; + } + return s; + } + } + /** + * + * + *
+     * The URI of the content. Only Cloud Storage URIs (e.g.
+     * `gs://bucket-name/path/to/file`) are supported. The maximum file size
+     * is 100 MB.
+     * 
+ * + * string uri = 3; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = ""; + if (contentCase_ == 3) { + ref = content_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (contentCase_ == 3) { + content_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MIME_TYPE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object mimeType_ = ""; + /** + * + * + *
+     * The MIME type of the content. Supported types:
+     *
+     * * `application/pdf` (PDF, only native PDFs are supported for now)
+     * * `text/html` (HTML)
+     * * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX)
+     * * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX)
+     * * `text/plain` (TXT)
+     *
+     * See https://www.iana.org/assignments/media-types/media-types.xhtml.
+     * 
+ * + * string mime_type = 1; + * + * @return The mimeType. + */ + @java.lang.Override + public java.lang.String getMimeType() { + java.lang.Object ref = mimeType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mimeType_ = s; + return s; + } + } + /** + * + * + *
+     * The MIME type of the content. Supported types:
+     *
+     * * `application/pdf` (PDF, only native PDFs are supported for now)
+     * * `text/html` (HTML)
+     * * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX)
+     * * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX)
+     * * `text/plain` (TXT)
+     *
+     * See https://www.iana.org/assignments/media-types/media-types.xhtml.
+     * 
+ * + * string mime_type = 1; + * + * @return The bytes for mimeType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMimeTypeBytes() { + java.lang.Object ref = mimeType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mimeType_ = 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(mimeType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mimeType_); + } + if (contentCase_ == 2) { + output.writeBytes(2, (com.google.protobuf.ByteString) content_); + } + if (contentCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mimeType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mimeType_); + } + if (contentCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 2, (com.google.protobuf.ByteString) content_); + } + if (contentCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.Document.Content)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.Document.Content other = + (com.google.cloud.discoveryengine.v1alpha.Document.Content) obj; + + if (!getMimeType().equals(other.getMimeType())) return false; + if (!getContentCase().equals(other.getContentCase())) return false; + switch (contentCase_) { + case 2: + if (!getRawBytes().equals(other.getRawBytes())) return false; + break; + case 3: + if (!getUri().equals(other.getUri())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MIME_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getMimeType().hashCode(); + switch (contentCase_) { + case 2: + hash = (37 * hash) + RAW_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getRawBytes().hashCode(); + break; + case 3: + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.Document.Content parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document.Content parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document.Content parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document.Content parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document.Content parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document.Content parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document.Content parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document.Content parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document.Content parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document.Content parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document.Content parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document.Content parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.Document.Content prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Unstructured data linked to this document.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.Document.Content} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.Document.Content) + com.google.cloud.discoveryengine.v1alpha.Document.ContentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.DocumentProto + .internal_static_google_cloud_discoveryengine_v1alpha_Document_Content_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.DocumentProto + .internal_static_google_cloud_discoveryengine_v1alpha_Document_Content_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.Document.Content.class, + com.google.cloud.discoveryengine.v1alpha.Document.Content.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.Document.Content.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + mimeType_ = ""; + contentCase_ = 0; + content_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.DocumentProto + .internal_static_google_cloud_discoveryengine_v1alpha_Document_Content_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Document.Content getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.Document.Content.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Document.Content build() { + com.google.cloud.discoveryengine.v1alpha.Document.Content result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Document.Content buildPartial() { + com.google.cloud.discoveryengine.v1alpha.Document.Content result = + new com.google.cloud.discoveryengine.v1alpha.Document.Content(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.Document.Content result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.mimeType_ = mimeType_; + } + } + + private void buildPartialOneofs( + com.google.cloud.discoveryengine.v1alpha.Document.Content result) { + result.contentCase_ = contentCase_; + result.content_ = this.content_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.Document.Content) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.Document.Content) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.Document.Content other) { + if (other == com.google.cloud.discoveryengine.v1alpha.Document.Content.getDefaultInstance()) + return this; + if (!other.getMimeType().isEmpty()) { + mimeType_ = other.mimeType_; + bitField0_ |= 0x00000004; + onChanged(); + } + switch (other.getContentCase()) { + case RAW_BYTES: + { + setRawBytes(other.getRawBytes()); + break; + } + case URI: + { + contentCase_ = 3; + content_ = other.content_; + onChanged(); + break; + } + case CONTENT_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + mimeType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 10 + case 18: + { + content_ = input.readBytes(); + contentCase_ = 2; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + contentCase_ = 3; + content_ = s; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int contentCase_ = 0; + private java.lang.Object content_; + + public ContentCase getContentCase() { + return ContentCase.forNumber(contentCase_); + } + + public Builder clearContent() { + contentCase_ = 0; + content_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+       * The content represented as a stream of bytes. The maximum length is
+       * 1,000,000 bytes (1 MB / ~0.95 MiB).
+       *
+       * Note: As with all `bytes` fields, this field is represented as pure
+       * binary in Protocol Buffers and base64-encoded string in JSON. For
+       * example, `abc123!?$*&()'-=@~` should be represented as
+       * `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See
+       * https://developers.google.com/protocol-buffers/docs/proto3#json.
+       * 
+ * + * bytes raw_bytes = 2; + * + * @return Whether the rawBytes field is set. + */ + public boolean hasRawBytes() { + return contentCase_ == 2; + } + /** + * + * + *
+       * The content represented as a stream of bytes. The maximum length is
+       * 1,000,000 bytes (1 MB / ~0.95 MiB).
+       *
+       * Note: As with all `bytes` fields, this field is represented as pure
+       * binary in Protocol Buffers and base64-encoded string in JSON. For
+       * example, `abc123!?$*&()'-=@~` should be represented as
+       * `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See
+       * https://developers.google.com/protocol-buffers/docs/proto3#json.
+       * 
+ * + * bytes raw_bytes = 2; + * + * @return The rawBytes. + */ + public com.google.protobuf.ByteString getRawBytes() { + if (contentCase_ == 2) { + return (com.google.protobuf.ByteString) content_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * + * + *
+       * The content represented as a stream of bytes. The maximum length is
+       * 1,000,000 bytes (1 MB / ~0.95 MiB).
+       *
+       * Note: As with all `bytes` fields, this field is represented as pure
+       * binary in Protocol Buffers and base64-encoded string in JSON. For
+       * example, `abc123!?$*&()'-=@~` should be represented as
+       * `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See
+       * https://developers.google.com/protocol-buffers/docs/proto3#json.
+       * 
+ * + * bytes raw_bytes = 2; + * + * @param value The rawBytes to set. + * @return This builder for chaining. + */ + public Builder setRawBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + contentCase_ = 2; + content_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The content represented as a stream of bytes. The maximum length is
+       * 1,000,000 bytes (1 MB / ~0.95 MiB).
+       *
+       * Note: As with all `bytes` fields, this field is represented as pure
+       * binary in Protocol Buffers and base64-encoded string in JSON. For
+       * example, `abc123!?$*&()'-=@~` should be represented as
+       * `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See
+       * https://developers.google.com/protocol-buffers/docs/proto3#json.
+       * 
+ * + * bytes raw_bytes = 2; + * + * @return This builder for chaining. + */ + public Builder clearRawBytes() { + if (contentCase_ == 2) { + contentCase_ = 0; + content_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * The URI of the content. Only Cloud Storage URIs (e.g.
+       * `gs://bucket-name/path/to/file`) are supported. The maximum file size
+       * is 100 MB.
+       * 
+ * + * string uri = 3; + * + * @return Whether the uri field is set. + */ + @java.lang.Override + public boolean hasUri() { + return contentCase_ == 3; + } + /** + * + * + *
+       * The URI of the content. Only Cloud Storage URIs (e.g.
+       * `gs://bucket-name/path/to/file`) are supported. The maximum file size
+       * is 100 MB.
+       * 
+ * + * string uri = 3; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = ""; + if (contentCase_ == 3) { + ref = content_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (contentCase_ == 3) { + content_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The URI of the content. Only Cloud Storage URIs (e.g.
+       * `gs://bucket-name/path/to/file`) are supported. The maximum file size
+       * is 100 MB.
+       * 
+ * + * string uri = 3; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = ""; + if (contentCase_ == 3) { + ref = content_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (contentCase_ == 3) { + content_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The URI of the content. Only Cloud Storage URIs (e.g.
+       * `gs://bucket-name/path/to/file`) are supported. The maximum file size
+       * is 100 MB.
+       * 
+ * + * 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(); + } + contentCase_ = 3; + content_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The URI of the content. Only Cloud Storage URIs (e.g.
+       * `gs://bucket-name/path/to/file`) are supported. The maximum file size
+       * is 100 MB.
+       * 
+ * + * string uri = 3; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + if (contentCase_ == 3) { + contentCase_ = 0; + content_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+       * The URI of the content. Only Cloud Storage URIs (e.g.
+       * `gs://bucket-name/path/to/file`) are supported. The maximum file size
+       * is 100 MB.
+       * 
+ * + * 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); + contentCase_ = 3; + content_ = value; + onChanged(); + return this; + } + + private java.lang.Object mimeType_ = ""; + /** + * + * + *
+       * The MIME type of the content. Supported types:
+       *
+       * * `application/pdf` (PDF, only native PDFs are supported for now)
+       * * `text/html` (HTML)
+       * * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX)
+       * * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX)
+       * * `text/plain` (TXT)
+       *
+       * See https://www.iana.org/assignments/media-types/media-types.xhtml.
+       * 
+ * + * string mime_type = 1; + * + * @return The mimeType. + */ + public java.lang.String getMimeType() { + java.lang.Object ref = mimeType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mimeType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The MIME type of the content. Supported types:
+       *
+       * * `application/pdf` (PDF, only native PDFs are supported for now)
+       * * `text/html` (HTML)
+       * * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX)
+       * * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX)
+       * * `text/plain` (TXT)
+       *
+       * See https://www.iana.org/assignments/media-types/media-types.xhtml.
+       * 
+ * + * string mime_type = 1; + * + * @return The bytes for mimeType. + */ + public com.google.protobuf.ByteString getMimeTypeBytes() { + java.lang.Object ref = mimeType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mimeType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The MIME type of the content. Supported types:
+       *
+       * * `application/pdf` (PDF, only native PDFs are supported for now)
+       * * `text/html` (HTML)
+       * * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX)
+       * * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX)
+       * * `text/plain` (TXT)
+       *
+       * See https://www.iana.org/assignments/media-types/media-types.xhtml.
+       * 
+ * + * string mime_type = 1; + * + * @param value The mimeType to set. + * @return This builder for chaining. + */ + public Builder setMimeType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + mimeType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * The MIME type of the content. Supported types:
+       *
+       * * `application/pdf` (PDF, only native PDFs are supported for now)
+       * * `text/html` (HTML)
+       * * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX)
+       * * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX)
+       * * `text/plain` (TXT)
+       *
+       * See https://www.iana.org/assignments/media-types/media-types.xhtml.
+       * 
+ * + * string mime_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearMimeType() { + mimeType_ = getDefaultInstance().getMimeType(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * The MIME type of the content. Supported types:
+       *
+       * * `application/pdf` (PDF, only native PDFs are supported for now)
+       * * `text/html` (HTML)
+       * * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX)
+       * * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX)
+       * * `text/plain` (TXT)
+       *
+       * See https://www.iana.org/assignments/media-types/media-types.xhtml.
+       * 
+ * + * string mime_type = 1; + * + * @param value The bytes for mimeType to set. + * @return This builder for chaining. + */ + public Builder setMimeTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + mimeType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.Document.Content) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.Document.Content) + private static final com.google.cloud.discoveryengine.v1alpha.Document.Content DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.Document.Content(); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document.Content getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Content parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Document.Content getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int dataCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object data_; + + public enum DataCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STRUCT_DATA(4), + JSON_DATA(5), + DATA_NOT_SET(0); + private final int value; + + private DataCase(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 DataCase valueOf(int value) { + return forNumber(value); + } + + public static DataCase forNumber(int value) { + switch (value) { + case 4: + return STRUCT_DATA; + case 5: + return JSON_DATA; + case 0: + return DATA_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DataCase getDataCase() { + return DataCase.forNumber(dataCase_); + } + + public static final int STRUCT_DATA_FIELD_NUMBER = 4; + /** + * + * + *
+   * The structured JSON data for the document. It should conform to the
+   * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
+   * 
+ * + * .google.protobuf.Struct struct_data = 4; + * + * @return Whether the structData field is set. + */ + @java.lang.Override + public boolean hasStructData() { + return dataCase_ == 4; + } + /** + * + * + *
+   * The structured JSON data for the document. It should conform to the
+   * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
+   * 
+ * + * .google.protobuf.Struct struct_data = 4; + * + * @return The structData. + */ + @java.lang.Override + public com.google.protobuf.Struct getStructData() { + if (dataCase_ == 4) { + return (com.google.protobuf.Struct) data_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + /** + * + * + *
+   * The structured JSON data for the document. It should conform to the
+   * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
+   * 
+ * + * .google.protobuf.Struct struct_data = 4; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getStructDataOrBuilder() { + if (dataCase_ == 4) { + return (com.google.protobuf.Struct) data_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + + public static final int JSON_DATA_FIELD_NUMBER = 5; + /** + * + * + *
+   * The JSON string representation of the document. It should conform to the
+   * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
+   * 
+ * + * string json_data = 5; + * + * @return Whether the jsonData field is set. + */ + public boolean hasJsonData() { + return dataCase_ == 5; + } + /** + * + * + *
+   * The JSON string representation of the document. It should conform to the
+   * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
+   * 
+ * + * string json_data = 5; + * + * @return The jsonData. + */ + public java.lang.String getJsonData() { + java.lang.Object ref = ""; + if (dataCase_ == 5) { + ref = data_; + } + if (ref instanceof java.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 (dataCase_ == 5) { + data_ = s; + } + return s; + } + } + /** + * + * + *
+   * The JSON string representation of the document. It should conform to the
+   * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
+   * 
+ * + * string json_data = 5; + * + * @return The bytes for jsonData. + */ + public com.google.protobuf.ByteString getJsonDataBytes() { + java.lang.Object ref = ""; + if (dataCase_ == 5) { + ref = data_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (dataCase_ == 5) { + data_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Immutable. The full resource name of the document.
+   * Format:
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`.
+   *
+   * This field must be a UTF-8 encoded string with a length limit of 1024
+   * characters.
+   * 
+ * + * 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. The full resource name of the document.
+   * Format:
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`.
+   *
+   * This field must be a UTF-8 encoded string with a length limit of 1024
+   * characters.
+   * 
+ * + * 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; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * + * + *
+   * Immutable. The identifier of the document.
+   *
+   * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+   * standard with a length limit of 63 characters.
+   * 
+ * + * 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. The identifier of the document.
+   *
+   * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+   * standard with a length limit of 63 characters.
+   * 
+ * + * 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 SCHEMA_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object schemaId_ = ""; + /** + * + * + *
+   * The identifier of the schema located in the same data store.
+   * 
+ * + * string schema_id = 3; + * + * @return The schemaId. + */ + @java.lang.Override + public java.lang.String getSchemaId() { + java.lang.Object ref = schemaId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + schemaId_ = s; + return s; + } + } + /** + * + * + *
+   * The identifier of the schema located in the same data store.
+   * 
+ * + * string schema_id = 3; + * + * @return The bytes for schemaId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSchemaIdBytes() { + java.lang.Object ref = schemaId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schemaId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_FIELD_NUMBER = 10; + private com.google.cloud.discoveryengine.v1alpha.Document.Content content_; + /** + * + * + *
+   * The unstructured data linked to this document. Content must be set if this
+   * document is under a
+   * `CONTENT_REQUIRED` data store.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document.Content content = 10; + * + * @return Whether the content field is set. + */ + @java.lang.Override + public boolean hasContent() { + return content_ != null; + } + /** + * + * + *
+   * The unstructured data linked to this document. Content must be set if this
+   * document is under a
+   * `CONTENT_REQUIRED` data store.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document.Content content = 10; + * + * @return The content. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Document.Content getContent() { + return content_ == null + ? com.google.cloud.discoveryengine.v1alpha.Document.Content.getDefaultInstance() + : content_; + } + /** + * + * + *
+   * The unstructured data linked to this document. Content must be set if this
+   * document is under a
+   * `CONTENT_REQUIRED` data store.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document.Content content = 10; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Document.ContentOrBuilder getContentOrBuilder() { + return content_ == null + ? com.google.cloud.discoveryengine.v1alpha.Document.Content.getDefaultInstance() + : content_; + } + + public static final int PARENT_DOCUMENT_ID_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object parentDocumentId_ = ""; + /** + * + * + *
+   * The identifier of the parent document. Currently supports at most two level
+   * document hierarchy.
+   *
+   * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+   * standard with a length limit of 63 characters.
+   * 
+ * + * string parent_document_id = 7; + * + * @return The parentDocumentId. + */ + @java.lang.Override + public java.lang.String getParentDocumentId() { + java.lang.Object ref = parentDocumentId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parentDocumentId_ = s; + return s; + } + } + /** + * + * + *
+   * The identifier of the parent document. Currently supports at most two level
+   * document hierarchy.
+   *
+   * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+   * standard with a length limit of 63 characters.
+   * 
+ * + * string parent_document_id = 7; + * + * @return The bytes for parentDocumentId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentDocumentIdBytes() { + java.lang.Object ref = parentDocumentId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parentDocumentId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DERIVED_STRUCT_DATA_FIELD_NUMBER = 6; + private com.google.protobuf.Struct derivedStructData_; + /** + * + * + *
+   * Output only. This field is OUTPUT_ONLY.
+   * It contains derived data that are not in the original input document.
+   * 
+ * + * + * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the derivedStructData field is set. + */ + @java.lang.Override + public boolean hasDerivedStructData() { + return derivedStructData_ != null; + } + /** + * + * + *
+   * Output only. This field is OUTPUT_ONLY.
+   * It contains derived data that are not in the original input document.
+   * 
+ * + * + * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The derivedStructData. + */ + @java.lang.Override + public com.google.protobuf.Struct getDerivedStructData() { + return derivedStructData_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : derivedStructData_; + } + /** + * + * + *
+   * Output only. This field is OUTPUT_ONLY.
+   * It contains derived data that are not in the original input document.
+   * 
+ * + * + * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getDerivedStructDataOrBuilder() { + return derivedStructData_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : derivedStructData_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(schemaId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, schemaId_); + } + if (dataCase_ == 4) { + output.writeMessage(4, (com.google.protobuf.Struct) data_); + } + if (dataCase_ == 5) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, data_); + } + if (derivedStructData_ != null) { + output.writeMessage(6, getDerivedStructData()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parentDocumentId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, parentDocumentId_); + } + if (content_ != null) { + output.writeMessage(10, getContent()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(schemaId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, schemaId_); + } + if (dataCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.protobuf.Struct) data_); + } + if (dataCase_ == 5) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, data_); + } + if (derivedStructData_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getDerivedStructData()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parentDocumentId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, parentDocumentId_); + } + if (content_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getContent()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.Document)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.Document other = + (com.google.cloud.discoveryengine.v1alpha.Document) obj; + + if (!getName().equals(other.getName())) return false; + if (!getId().equals(other.getId())) return false; + if (!getSchemaId().equals(other.getSchemaId())) return false; + if (hasContent() != other.hasContent()) return false; + if (hasContent()) { + if (!getContent().equals(other.getContent())) return false; + } + if (!getParentDocumentId().equals(other.getParentDocumentId())) return false; + if (hasDerivedStructData() != other.hasDerivedStructData()) return false; + if (hasDerivedStructData()) { + if (!getDerivedStructData().equals(other.getDerivedStructData())) return false; + } + if (!getDataCase().equals(other.getDataCase())) return false; + switch (dataCase_) { + case 4: + if (!getStructData().equals(other.getStructData())) return false; + break; + case 5: + if (!getJsonData().equals(other.getJsonData())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + 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) + SCHEMA_ID_FIELD_NUMBER; + hash = (53 * hash) + getSchemaId().hashCode(); + if (hasContent()) { + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + } + hash = (37 * hash) + PARENT_DOCUMENT_ID_FIELD_NUMBER; + hash = (53 * hash) + getParentDocumentId().hashCode(); + if (hasDerivedStructData()) { + hash = (37 * hash) + DERIVED_STRUCT_DATA_FIELD_NUMBER; + hash = (53 * hash) + getDerivedStructData().hashCode(); + } + switch (dataCase_) { + case 4: + hash = (37 * hash) + STRUCT_DATA_FIELD_NUMBER; + hash = (53 * hash) + getStructData().hashCode(); + break; + case 5: + hash = (37 * hash) + JSON_DATA_FIELD_NUMBER; + hash = (53 * hash) + getJsonData().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.Document parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.discoveryengine.v1alpha.Document prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Document captures all raw metadata information of items to be recommended or
+   * searched.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.Document} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.Document) + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.DocumentProto + .internal_static_google_cloud_discoveryengine_v1alpha_Document_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.DocumentProto + .internal_static_google_cloud_discoveryengine_v1alpha_Document_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.Document.class, + com.google.cloud.discoveryengine.v1alpha.Document.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.Document.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (structDataBuilder_ != null) { + structDataBuilder_.clear(); + } + name_ = ""; + id_ = ""; + schemaId_ = ""; + content_ = null; + if (contentBuilder_ != null) { + contentBuilder_.dispose(); + contentBuilder_ = null; + } + parentDocumentId_ = ""; + derivedStructData_ = null; + if (derivedStructDataBuilder_ != null) { + derivedStructDataBuilder_.dispose(); + derivedStructDataBuilder_ = null; + } + dataCase_ = 0; + data_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.DocumentProto + .internal_static_google_cloud_discoveryengine_v1alpha_Document_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Document getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Document build() { + com.google.cloud.discoveryengine.v1alpha.Document result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Document buildPartial() { + com.google.cloud.discoveryengine.v1alpha.Document result = + new com.google.cloud.discoveryengine.v1alpha.Document(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.Document result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.schemaId_ = schemaId_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.content_ = contentBuilder_ == null ? content_ : contentBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.parentDocumentId_ = parentDocumentId_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.derivedStructData_ = + derivedStructDataBuilder_ == null + ? derivedStructData_ + : derivedStructDataBuilder_.build(); + } + } + + private void buildPartialOneofs(com.google.cloud.discoveryengine.v1alpha.Document result) { + result.dataCase_ = dataCase_; + result.data_ = this.data_; + if (dataCase_ == 4 && structDataBuilder_ != null) { + result.data_ = structDataBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.Document) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.Document) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.Document other) { + if (other == com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getSchemaId().isEmpty()) { + schemaId_ = other.schemaId_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasContent()) { + mergeContent(other.getContent()); + } + if (!other.getParentDocumentId().isEmpty()) { + parentDocumentId_ = other.parentDocumentId_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (other.hasDerivedStructData()) { + mergeDerivedStructData(other.getDerivedStructData()); + } + switch (other.getDataCase()) { + case STRUCT_DATA: + { + mergeStructData(other.getStructData()); + break; + } + case JSON_DATA: + { + dataCase_ = 5; + data_ = other.data_; + onChanged(); + break; + } + case DATA_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 10 + case 18: + { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 18 + case 26: + { + schemaId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 26 + case 34: + { + input.readMessage(getStructDataFieldBuilder().getBuilder(), extensionRegistry); + dataCase_ = 4; + break; + } // case 34 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + dataCase_ = 5; + data_ = s; + break; + } // case 42 + case 50: + { + input.readMessage( + getDerivedStructDataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 50 + case 58: + { + parentDocumentId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 82: + { + input.readMessage(getContentFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 82 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int dataCase_ = 0; + private java.lang.Object data_; + + public DataCase getDataCase() { + return DataCase.forNumber(dataCase_); + } + + public Builder clearData() { + dataCase_ = 0; + data_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + structDataBuilder_; + /** + * + * + *
+     * The structured JSON data for the document. It should conform to the
+     * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
+     * 
+ * + * .google.protobuf.Struct struct_data = 4; + * + * @return Whether the structData field is set. + */ + @java.lang.Override + public boolean hasStructData() { + return dataCase_ == 4; + } + /** + * + * + *
+     * The structured JSON data for the document. It should conform to the
+     * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
+     * 
+ * + * .google.protobuf.Struct struct_data = 4; + * + * @return The structData. + */ + @java.lang.Override + public com.google.protobuf.Struct getStructData() { + if (structDataBuilder_ == null) { + if (dataCase_ == 4) { + return (com.google.protobuf.Struct) data_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } else { + if (dataCase_ == 4) { + return structDataBuilder_.getMessage(); + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + } + /** + * + * + *
+     * The structured JSON data for the document. It should conform to the
+     * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
+     * 
+ * + * .google.protobuf.Struct struct_data = 4; + */ + public Builder setStructData(com.google.protobuf.Struct value) { + if (structDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + onChanged(); + } else { + structDataBuilder_.setMessage(value); + } + dataCase_ = 4; + return this; + } + /** + * + * + *
+     * The structured JSON data for the document. It should conform to the
+     * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
+     * 
+ * + * .google.protobuf.Struct struct_data = 4; + */ + public Builder setStructData(com.google.protobuf.Struct.Builder builderForValue) { + if (structDataBuilder_ == null) { + data_ = builderForValue.build(); + onChanged(); + } else { + structDataBuilder_.setMessage(builderForValue.build()); + } + dataCase_ = 4; + return this; + } + /** + * + * + *
+     * The structured JSON data for the document. It should conform to the
+     * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
+     * 
+ * + * .google.protobuf.Struct struct_data = 4; + */ + public Builder mergeStructData(com.google.protobuf.Struct value) { + if (structDataBuilder_ == null) { + if (dataCase_ == 4 && data_ != com.google.protobuf.Struct.getDefaultInstance()) { + data_ = + com.google.protobuf.Struct.newBuilder((com.google.protobuf.Struct) data_) + .mergeFrom(value) + .buildPartial(); + } else { + data_ = value; + } + onChanged(); + } else { + if (dataCase_ == 4) { + structDataBuilder_.mergeFrom(value); + } else { + structDataBuilder_.setMessage(value); + } + } + dataCase_ = 4; + return this; + } + /** + * + * + *
+     * The structured JSON data for the document. It should conform to the
+     * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
+     * 
+ * + * .google.protobuf.Struct struct_data = 4; + */ + public Builder clearStructData() { + if (structDataBuilder_ == null) { + if (dataCase_ == 4) { + dataCase_ = 0; + data_ = null; + onChanged(); + } + } else { + if (dataCase_ == 4) { + dataCase_ = 0; + data_ = null; + } + structDataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The structured JSON data for the document. It should conform to the
+     * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
+     * 
+ * + * .google.protobuf.Struct struct_data = 4; + */ + public com.google.protobuf.Struct.Builder getStructDataBuilder() { + return getStructDataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The structured JSON data for the document. It should conform to the
+     * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
+     * 
+ * + * .google.protobuf.Struct struct_data = 4; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getStructDataOrBuilder() { + if ((dataCase_ == 4) && (structDataBuilder_ != null)) { + return structDataBuilder_.getMessageOrBuilder(); + } else { + if (dataCase_ == 4) { + return (com.google.protobuf.Struct) data_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + } + /** + * + * + *
+     * The structured JSON data for the document. It should conform to the
+     * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
+     * 
+ * + * .google.protobuf.Struct struct_data = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getStructDataFieldBuilder() { + if (structDataBuilder_ == null) { + if (!(dataCase_ == 4)) { + data_ = com.google.protobuf.Struct.getDefaultInstance(); + } + structDataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + (com.google.protobuf.Struct) data_, getParentForChildren(), isClean()); + data_ = null; + } + dataCase_ = 4; + onChanged(); + return structDataBuilder_; + } + + /** + * + * + *
+     * The JSON string representation of the document. It should conform to the
+     * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
+     * 
+ * + * string json_data = 5; + * + * @return Whether the jsonData field is set. + */ + @java.lang.Override + public boolean hasJsonData() { + return dataCase_ == 5; + } + /** + * + * + *
+     * The JSON string representation of the document. It should conform to the
+     * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
+     * 
+ * + * string json_data = 5; + * + * @return The jsonData. + */ + @java.lang.Override + public java.lang.String getJsonData() { + java.lang.Object ref = ""; + if (dataCase_ == 5) { + ref = data_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (dataCase_ == 5) { + data_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The JSON string representation of the document. It should conform to the
+     * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
+     * 
+ * + * string json_data = 5; + * + * @return The bytes for jsonData. + */ + @java.lang.Override + public com.google.protobuf.ByteString getJsonDataBytes() { + java.lang.Object ref = ""; + if (dataCase_ == 5) { + ref = data_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (dataCase_ == 5) { + data_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The JSON string representation of the document. It should conform to the
+     * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
+     * 
+ * + * string json_data = 5; + * + * @param value The jsonData to set. + * @return This builder for chaining. + */ + public Builder setJsonData(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dataCase_ = 5; + data_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The JSON string representation of the document. It should conform to the
+     * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
+     * 
+ * + * string json_data = 5; + * + * @return This builder for chaining. + */ + public Builder clearJsonData() { + if (dataCase_ == 5) { + dataCase_ = 0; + data_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The JSON string representation of the document. It should conform to the
+     * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+     * `INVALID_ARGUMENT` error is thrown.
+     * 
+ * + * string json_data = 5; + * + * @param value The bytes for jsonData to set. + * @return This builder for chaining. + */ + public Builder setJsonDataBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dataCase_ = 5; + data_ = value; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. The full resource name of the document.
+     * Format:
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`.
+     *
+     * This field must be a UTF-8 encoded string with a length limit of 1024
+     * characters.
+     * 
+ * + * 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. The full resource name of the document.
+     * Format:
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`.
+     *
+     * This field must be a UTF-8 encoded string with a length limit of 1024
+     * characters.
+     * 
+ * + * 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. The full resource name of the document.
+     * Format:
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`.
+     *
+     * This field must be a UTF-8 encoded string with a length limit of 1024
+     * characters.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The full resource name of the document.
+     * Format:
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`.
+     *
+     * This field must be a UTF-8 encoded string with a length limit of 1024
+     * characters.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The full resource name of the document.
+     * Format:
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`.
+     *
+     * This field must be a UTF-8 encoded string with a length limit of 1024
+     * characters.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object id_ = ""; + /** + * + * + *
+     * Immutable. The identifier of the document.
+     *
+     * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+     * standard with a length limit of 63 characters.
+     * 
+ * + * 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. The identifier of the document.
+     *
+     * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+     * standard with a length limit of 63 characters.
+     * 
+ * + * 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. The identifier of the document.
+     *
+     * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+     * standard with a length limit of 63 characters.
+     * 
+ * + * 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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The identifier of the document.
+     *
+     * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+     * standard with a length limit of 63 characters.
+     * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The identifier of the document.
+     *
+     * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+     * standard with a length limit of 63 characters.
+     * 
+ * + * 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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object schemaId_ = ""; + /** + * + * + *
+     * The identifier of the schema located in the same data store.
+     * 
+ * + * string schema_id = 3; + * + * @return The schemaId. + */ + public java.lang.String getSchemaId() { + java.lang.Object ref = schemaId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + schemaId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The identifier of the schema located in the same data store.
+     * 
+ * + * string schema_id = 3; + * + * @return The bytes for schemaId. + */ + public com.google.protobuf.ByteString getSchemaIdBytes() { + java.lang.Object ref = schemaId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + schemaId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The identifier of the schema located in the same data store.
+     * 
+ * + * string schema_id = 3; + * + * @param value The schemaId to set. + * @return This builder for chaining. + */ + public Builder setSchemaId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + schemaId_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The identifier of the schema located in the same data store.
+     * 
+ * + * string schema_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearSchemaId() { + schemaId_ = getDefaultInstance().getSchemaId(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * The identifier of the schema located in the same data store.
+     * 
+ * + * string schema_id = 3; + * + * @param value The bytes for schemaId to set. + * @return This builder for chaining. + */ + public Builder setSchemaIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + schemaId_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1alpha.Document.Content content_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Document.Content, + com.google.cloud.discoveryengine.v1alpha.Document.Content.Builder, + com.google.cloud.discoveryengine.v1alpha.Document.ContentOrBuilder> + contentBuilder_; + /** + * + * + *
+     * The unstructured data linked to this document. Content must be set if this
+     * document is under a
+     * `CONTENT_REQUIRED` data store.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document.Content content = 10; + * + * @return Whether the content field is set. + */ + public boolean hasContent() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * The unstructured data linked to this document. Content must be set if this
+     * document is under a
+     * `CONTENT_REQUIRED` data store.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document.Content content = 10; + * + * @return The content. + */ + public com.google.cloud.discoveryengine.v1alpha.Document.Content getContent() { + if (contentBuilder_ == null) { + return content_ == null + ? com.google.cloud.discoveryengine.v1alpha.Document.Content.getDefaultInstance() + : content_; + } else { + return contentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The unstructured data linked to this document. Content must be set if this
+     * document is under a
+     * `CONTENT_REQUIRED` data store.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document.Content content = 10; + */ + public Builder setContent(com.google.cloud.discoveryengine.v1alpha.Document.Content value) { + if (contentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + } else { + contentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The unstructured data linked to this document. Content must be set if this
+     * document is under a
+     * `CONTENT_REQUIRED` data store.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document.Content content = 10; + */ + public Builder setContent( + com.google.cloud.discoveryengine.v1alpha.Document.Content.Builder builderForValue) { + if (contentBuilder_ == null) { + content_ = builderForValue.build(); + } else { + contentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The unstructured data linked to this document. Content must be set if this
+     * document is under a
+     * `CONTENT_REQUIRED` data store.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document.Content content = 10; + */ + public Builder mergeContent(com.google.cloud.discoveryengine.v1alpha.Document.Content value) { + if (contentBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && content_ != null + && content_ + != com.google.cloud.discoveryengine.v1alpha.Document.Content.getDefaultInstance()) { + getContentBuilder().mergeFrom(value); + } else { + content_ = value; + } + } else { + contentBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The unstructured data linked to this document. Content must be set if this
+     * document is under a
+     * `CONTENT_REQUIRED` data store.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document.Content content = 10; + */ + public Builder clearContent() { + bitField0_ = (bitField0_ & ~0x00000020); + content_ = null; + if (contentBuilder_ != null) { + contentBuilder_.dispose(); + contentBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The unstructured data linked to this document. Content must be set if this
+     * document is under a
+     * `CONTENT_REQUIRED` data store.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document.Content content = 10; + */ + public com.google.cloud.discoveryengine.v1alpha.Document.Content.Builder getContentBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getContentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The unstructured data linked to this document. Content must be set if this
+     * document is under a
+     * `CONTENT_REQUIRED` data store.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document.Content content = 10; + */ + public com.google.cloud.discoveryengine.v1alpha.Document.ContentOrBuilder + getContentOrBuilder() { + if (contentBuilder_ != null) { + return contentBuilder_.getMessageOrBuilder(); + } else { + return content_ == null + ? com.google.cloud.discoveryengine.v1alpha.Document.Content.getDefaultInstance() + : content_; + } + } + /** + * + * + *
+     * The unstructured data linked to this document. Content must be set if this
+     * document is under a
+     * `CONTENT_REQUIRED` data store.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document.Content content = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Document.Content, + com.google.cloud.discoveryengine.v1alpha.Document.Content.Builder, + com.google.cloud.discoveryengine.v1alpha.Document.ContentOrBuilder> + getContentFieldBuilder() { + if (contentBuilder_ == null) { + contentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Document.Content, + com.google.cloud.discoveryengine.v1alpha.Document.Content.Builder, + com.google.cloud.discoveryengine.v1alpha.Document.ContentOrBuilder>( + getContent(), getParentForChildren(), isClean()); + content_ = null; + } + return contentBuilder_; + } + + private java.lang.Object parentDocumentId_ = ""; + /** + * + * + *
+     * The identifier of the parent document. Currently supports at most two level
+     * document hierarchy.
+     *
+     * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+     * standard with a length limit of 63 characters.
+     * 
+ * + * string parent_document_id = 7; + * + * @return The parentDocumentId. + */ + public java.lang.String getParentDocumentId() { + java.lang.Object ref = parentDocumentId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parentDocumentId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The identifier of the parent document. Currently supports at most two level
+     * document hierarchy.
+     *
+     * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+     * standard with a length limit of 63 characters.
+     * 
+ * + * string parent_document_id = 7; + * + * @return The bytes for parentDocumentId. + */ + public com.google.protobuf.ByteString getParentDocumentIdBytes() { + java.lang.Object ref = parentDocumentId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parentDocumentId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The identifier of the parent document. Currently supports at most two level
+     * document hierarchy.
+     *
+     * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+     * standard with a length limit of 63 characters.
+     * 
+ * + * string parent_document_id = 7; + * + * @param value The parentDocumentId to set. + * @return This builder for chaining. + */ + public Builder setParentDocumentId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parentDocumentId_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The identifier of the parent document. Currently supports at most two level
+     * document hierarchy.
+     *
+     * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+     * standard with a length limit of 63 characters.
+     * 
+ * + * string parent_document_id = 7; + * + * @return This builder for chaining. + */ + public Builder clearParentDocumentId() { + parentDocumentId_ = getDefaultInstance().getParentDocumentId(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * The identifier of the parent document. Currently supports at most two level
+     * document hierarchy.
+     *
+     * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+     * standard with a length limit of 63 characters.
+     * 
+ * + * string parent_document_id = 7; + * + * @param value The bytes for parentDocumentId to set. + * @return This builder for chaining. + */ + public Builder setParentDocumentIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parentDocumentId_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private com.google.protobuf.Struct derivedStructData_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + derivedStructDataBuilder_; + /** + * + * + *
+     * Output only. This field is OUTPUT_ONLY.
+     * It contains derived data that are not in the original input document.
+     * 
+ * + * + * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the derivedStructData field is set. + */ + public boolean hasDerivedStructData() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Output only. This field is OUTPUT_ONLY.
+     * It contains derived data that are not in the original input document.
+     * 
+ * + * + * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The derivedStructData. + */ + public com.google.protobuf.Struct getDerivedStructData() { + if (derivedStructDataBuilder_ == null) { + return derivedStructData_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : derivedStructData_; + } else { + return derivedStructDataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. This field is OUTPUT_ONLY.
+     * It contains derived data that are not in the original input document.
+     * 
+ * + * + * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDerivedStructData(com.google.protobuf.Struct value) { + if (derivedStructDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + derivedStructData_ = value; + } else { + derivedStructDataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This field is OUTPUT_ONLY.
+     * It contains derived data that are not in the original input document.
+     * 
+ * + * + * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDerivedStructData(com.google.protobuf.Struct.Builder builderForValue) { + if (derivedStructDataBuilder_ == null) { + derivedStructData_ = builderForValue.build(); + } else { + derivedStructDataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This field is OUTPUT_ONLY.
+     * It contains derived data that are not in the original input document.
+     * 
+ * + * + * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDerivedStructData(com.google.protobuf.Struct value) { + if (derivedStructDataBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && derivedStructData_ != null + && derivedStructData_ != com.google.protobuf.Struct.getDefaultInstance()) { + getDerivedStructDataBuilder().mergeFrom(value); + } else { + derivedStructData_ = value; + } + } else { + derivedStructDataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This field is OUTPUT_ONLY.
+     * It contains derived data that are not in the original input document.
+     * 
+ * + * + * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDerivedStructData() { + bitField0_ = (bitField0_ & ~0x00000080); + derivedStructData_ = null; + if (derivedStructDataBuilder_ != null) { + derivedStructDataBuilder_.dispose(); + derivedStructDataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This field is OUTPUT_ONLY.
+     * It contains derived data that are not in the original input document.
+     * 
+ * + * + * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Struct.Builder getDerivedStructDataBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getDerivedStructDataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. This field is OUTPUT_ONLY.
+     * It contains derived data that are not in the original input document.
+     * 
+ * + * + * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.StructOrBuilder getDerivedStructDataOrBuilder() { + if (derivedStructDataBuilder_ != null) { + return derivedStructDataBuilder_.getMessageOrBuilder(); + } else { + return derivedStructData_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : derivedStructData_; + } + } + /** + * + * + *
+     * Output only. This field is OUTPUT_ONLY.
+     * It contains derived data that are not in the original input document.
+     * 
+ * + * + * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getDerivedStructDataFieldBuilder() { + if (derivedStructDataBuilder_ == null) { + derivedStructDataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getDerivedStructData(), getParentForChildren(), isClean()); + derivedStructData_ = null; + } + return derivedStructDataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.Document) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.Document) + private static final com.google.cloud.discoveryengine.v1alpha.Document DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.Document(); + } + + public static com.google.cloud.discoveryengine.v1alpha.Document getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Document parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Document getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentInfo.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentInfo.java new file mode 100644 index 000000000000..e001072c5495 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentInfo.java @@ -0,0 +1,1731 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/user_event.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Detailed document information associated with a user event.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.DocumentInfo} + */ +public final class DocumentInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.DocumentInfo) + DocumentInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use DocumentInfo.newBuilder() to construct. + private DocumentInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DocumentInfo() { + promotionIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DocumentInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_DocumentInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_DocumentInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.DocumentInfo.class, + com.google.cloud.discoveryengine.v1alpha.DocumentInfo.Builder.class); + } + + private int bitField0_; + private int documentDescriptorCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object documentDescriptor_; + + public enum DocumentDescriptorCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ID(1), + NAME(2), + URI(6), + DOCUMENTDESCRIPTOR_NOT_SET(0); + private final int value; + + private DocumentDescriptorCase(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 DocumentDescriptorCase valueOf(int value) { + return forNumber(value); + } + + public static DocumentDescriptorCase forNumber(int value) { + switch (value) { + case 1: + return ID; + case 2: + return NAME; + case 6: + return URI; + case 0: + return DOCUMENTDESCRIPTOR_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DocumentDescriptorCase getDocumentDescriptorCase() { + return DocumentDescriptorCase.forNumber(documentDescriptorCase_); + } + + public static final int ID_FIELD_NUMBER = 1; + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+   * ID.
+   * 
+ * + * string id = 1; + * + * @return Whether the id field is set. + */ + public boolean hasId() { + return documentDescriptorCase_ == 1; + } + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+   * ID.
+   * 
+ * + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = ""; + if (documentDescriptorCase_ == 1) { + ref = documentDescriptor_; + } + if (ref instanceof java.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 (documentDescriptorCase_ == 1) { + documentDescriptor_ = s; + } + return s; + } + } + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+   * ID.
+   * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = ""; + if (documentDescriptorCase_ == 1) { + ref = documentDescriptor_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (documentDescriptorCase_ == 1) { + documentDescriptor_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 2; + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+   * full name, of the form:
+   * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
+   * 
+ * + * string name = 2 [(.google.api.resource_reference) = { ... } + * + * @return Whether the name field is set. + */ + public boolean hasName() { + return documentDescriptorCase_ == 2; + } + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+   * full name, of the form:
+   * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
+   * 
+ * + * string name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = ""; + if (documentDescriptorCase_ == 2) { + ref = documentDescriptor_; + } + if (ref instanceof java.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 (documentDescriptorCase_ == 2) { + documentDescriptor_ = s; + } + return s; + } + } + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+   * full name, of the form:
+   * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
+   * 
+ * + * string name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = ""; + if (documentDescriptorCase_ == 2) { + ref = documentDescriptor_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (documentDescriptorCase_ == 2) { + documentDescriptor_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int URI_FIELD_NUMBER = 6; + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document] URI - only
+   * allowed for website data stores.
+   * 
+ * + * string uri = 6; + * + * @return Whether the uri field is set. + */ + public boolean hasUri() { + return documentDescriptorCase_ == 6; + } + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document] URI - only
+   * allowed for website data stores.
+   * 
+ * + * string uri = 6; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = ""; + if (documentDescriptorCase_ == 6) { + ref = documentDescriptor_; + } + if (ref instanceof java.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 (documentDescriptorCase_ == 6) { + documentDescriptor_ = s; + } + return s; + } + } + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document] URI - only
+   * allowed for website data stores.
+   * 
+ * + * string uri = 6; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = ""; + if (documentDescriptorCase_ == 6) { + ref = documentDescriptor_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (documentDescriptorCase_ == 6) { + documentDescriptor_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUANTITY_FIELD_NUMBER = 3; + private int quantity_ = 0; + /** + * + * + *
+   * Quantity of the Document associated with the user event. Defaults to 1.
+   *
+   * For example, this field will be 2 if two quantities of the same Document
+   * are involved in a `add-to-cart` event.
+   *
+   * Required for events of the following event types:
+   *
+   * * `add-to-cart`
+   * * `purchase`
+   * 
+ * + * optional int32 quantity = 3; + * + * @return Whether the quantity field is set. + */ + @java.lang.Override + public boolean hasQuantity() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Quantity of the Document associated with the user event. Defaults to 1.
+   *
+   * For example, this field will be 2 if two quantities of the same Document
+   * are involved in a `add-to-cart` event.
+   *
+   * Required for events of the following event types:
+   *
+   * * `add-to-cart`
+   * * `purchase`
+   * 
+ * + * optional int32 quantity = 3; + * + * @return The quantity. + */ + @java.lang.Override + public int getQuantity() { + return quantity_; + } + + public static final int PROMOTION_IDS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList promotionIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * The promotion IDs associated with this Document.
+   * Currently, this field is restricted to at most one ID.
+   * 
+ * + * repeated string promotion_ids = 4; + * + * @return A list containing the promotionIds. + */ + public com.google.protobuf.ProtocolStringList getPromotionIdsList() { + return promotionIds_; + } + /** + * + * + *
+   * The promotion IDs associated with this Document.
+   * Currently, this field is restricted to at most one ID.
+   * 
+ * + * repeated string promotion_ids = 4; + * + * @return The count of promotionIds. + */ + public int getPromotionIdsCount() { + return promotionIds_.size(); + } + /** + * + * + *
+   * The promotion IDs associated with this Document.
+   * Currently, this field is restricted to at most one ID.
+   * 
+ * + * repeated string promotion_ids = 4; + * + * @param index The index of the element to return. + * @return The promotionIds at the given index. + */ + public java.lang.String getPromotionIds(int index) { + return promotionIds_.get(index); + } + /** + * + * + *
+   * The promotion IDs associated with this Document.
+   * Currently, this field is restricted to at most one ID.
+   * 
+ * + * repeated string promotion_ids = 4; + * + * @param index The index of the value to return. + * @return The bytes of the promotionIds at the given index. + */ + public com.google.protobuf.ByteString getPromotionIdsBytes(int index) { + return promotionIds_.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 (documentDescriptorCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, documentDescriptor_); + } + if (documentDescriptorCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, documentDescriptor_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(3, quantity_); + } + for (int i = 0; i < promotionIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, promotionIds_.getRaw(i)); + } + if (documentDescriptorCase_ == 6) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, documentDescriptor_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (documentDescriptorCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, documentDescriptor_); + } + if (documentDescriptorCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, documentDescriptor_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, quantity_); + } + { + int dataSize = 0; + for (int i = 0; i < promotionIds_.size(); i++) { + dataSize += computeStringSizeNoTag(promotionIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getPromotionIdsList().size(); + } + if (documentDescriptorCase_ == 6) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, documentDescriptor_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.DocumentInfo)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.DocumentInfo other = + (com.google.cloud.discoveryengine.v1alpha.DocumentInfo) obj; + + if (hasQuantity() != other.hasQuantity()) return false; + if (hasQuantity()) { + if (getQuantity() != other.getQuantity()) return false; + } + if (!getPromotionIdsList().equals(other.getPromotionIdsList())) return false; + if (!getDocumentDescriptorCase().equals(other.getDocumentDescriptorCase())) return false; + switch (documentDescriptorCase_) { + case 1: + if (!getId().equals(other.getId())) return false; + break; + case 2: + if (!getName().equals(other.getName())) return false; + break; + case 6: + if (!getUri().equals(other.getUri())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasQuantity()) { + hash = (37 * hash) + QUANTITY_FIELD_NUMBER; + hash = (53 * hash) + getQuantity(); + } + if (getPromotionIdsCount() > 0) { + hash = (37 * hash) + PROMOTION_IDS_FIELD_NUMBER; + hash = (53 * hash) + getPromotionIdsList().hashCode(); + } + switch (documentDescriptorCase_) { + case 1: + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + break; + case 2: + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + break; + case 6: + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.DocumentInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.DocumentInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DocumentInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.DocumentInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DocumentInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.DocumentInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DocumentInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.DocumentInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DocumentInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.DocumentInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DocumentInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.DocumentInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.DocumentInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 document information associated with a user event.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.DocumentInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.DocumentInfo) + com.google.cloud.discoveryengine.v1alpha.DocumentInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_DocumentInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_DocumentInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.DocumentInfo.class, + com.google.cloud.discoveryengine.v1alpha.DocumentInfo.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.DocumentInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + quantity_ = 0; + promotionIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + documentDescriptorCase_ = 0; + documentDescriptor_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_DocumentInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DocumentInfo getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.DocumentInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DocumentInfo build() { + com.google.cloud.discoveryengine.v1alpha.DocumentInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DocumentInfo buildPartial() { + com.google.cloud.discoveryengine.v1alpha.DocumentInfo result = + new com.google.cloud.discoveryengine.v1alpha.DocumentInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.DocumentInfo result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.quantity_ = quantity_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + promotionIds_.makeImmutable(); + result.promotionIds_ = promotionIds_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.discoveryengine.v1alpha.DocumentInfo result) { + result.documentDescriptorCase_ = documentDescriptorCase_; + result.documentDescriptor_ = this.documentDescriptor_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.DocumentInfo) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.DocumentInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.DocumentInfo other) { + if (other == com.google.cloud.discoveryengine.v1alpha.DocumentInfo.getDefaultInstance()) + return this; + if (other.hasQuantity()) { + setQuantity(other.getQuantity()); + } + if (!other.promotionIds_.isEmpty()) { + if (promotionIds_.isEmpty()) { + promotionIds_ = other.promotionIds_; + bitField0_ |= 0x00000010; + } else { + ensurePromotionIdsIsMutable(); + promotionIds_.addAll(other.promotionIds_); + } + onChanged(); + } + switch (other.getDocumentDescriptorCase()) { + case ID: + { + documentDescriptorCase_ = 1; + documentDescriptor_ = other.documentDescriptor_; + onChanged(); + break; + } + case NAME: + { + documentDescriptorCase_ = 2; + documentDescriptor_ = other.documentDescriptor_; + onChanged(); + break; + } + case URI: + { + documentDescriptorCase_ = 6; + documentDescriptor_ = other.documentDescriptor_; + onChanged(); + break; + } + case DOCUMENTDESCRIPTOR_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + documentDescriptorCase_ = 1; + documentDescriptor_ = s; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + documentDescriptorCase_ = 2; + documentDescriptor_ = s; + break; + } // case 18 + case 24: + { + quantity_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 24 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensurePromotionIdsIsMutable(); + promotionIds_.add(s); + break; + } // case 34 + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + documentDescriptorCase_ = 6; + documentDescriptor_ = s; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int documentDescriptorCase_ = 0; + private java.lang.Object documentDescriptor_; + + public DocumentDescriptorCase getDocumentDescriptorCase() { + return DocumentDescriptorCase.forNumber(documentDescriptorCase_); + } + + public Builder clearDocumentDescriptor() { + documentDescriptorCase_ = 0; + documentDescriptor_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+     * ID.
+     * 
+ * + * string id = 1; + * + * @return Whether the id field is set. + */ + @java.lang.Override + public boolean hasId() { + return documentDescriptorCase_ == 1; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+     * ID.
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = ""; + if (documentDescriptorCase_ == 1) { + ref = documentDescriptor_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (documentDescriptorCase_ == 1) { + documentDescriptor_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+     * ID.
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = ""; + if (documentDescriptorCase_ == 1) { + ref = documentDescriptor_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (documentDescriptorCase_ == 1) { + documentDescriptor_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+     * ID.
+     * 
+ * + * 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(); + } + documentDescriptorCase_ = 1; + documentDescriptor_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+     * ID.
+     * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + if (documentDescriptorCase_ == 1) { + documentDescriptorCase_ = 0; + documentDescriptor_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+     * ID.
+     * 
+ * + * 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); + documentDescriptorCase_ = 1; + documentDescriptor_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+     * full name, of the form:
+     * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
+     * 
+ * + * string name = 2 [(.google.api.resource_reference) = { ... } + * + * @return Whether the name field is set. + */ + @java.lang.Override + public boolean hasName() { + return documentDescriptorCase_ == 2; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+     * full name, of the form:
+     * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
+     * 
+ * + * string name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = ""; + if (documentDescriptorCase_ == 2) { + ref = documentDescriptor_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (documentDescriptorCase_ == 2) { + documentDescriptor_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+     * full name, of the form:
+     * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
+     * 
+ * + * string name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = ""; + if (documentDescriptorCase_ == 2) { + ref = documentDescriptor_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (documentDescriptorCase_ == 2) { + documentDescriptor_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+     * full name, of the form:
+     * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
+     * 
+ * + * string name = 2 [(.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(); + } + documentDescriptorCase_ = 2; + documentDescriptor_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+     * full name, of the form:
+     * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
+     * 
+ * + * string name = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearName() { + if (documentDescriptorCase_ == 2) { + documentDescriptorCase_ = 0; + documentDescriptor_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+     * full name, of the form:
+     * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
+     * 
+ * + * string name = 2 [(.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); + documentDescriptorCase_ = 2; + documentDescriptor_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document] URI - only
+     * allowed for website data stores.
+     * 
+ * + * string uri = 6; + * + * @return Whether the uri field is set. + */ + @java.lang.Override + public boolean hasUri() { + return documentDescriptorCase_ == 6; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document] URI - only
+     * allowed for website data stores.
+     * 
+ * + * string uri = 6; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = ""; + if (documentDescriptorCase_ == 6) { + ref = documentDescriptor_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (documentDescriptorCase_ == 6) { + documentDescriptor_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document] URI - only
+     * allowed for website data stores.
+     * 
+ * + * string uri = 6; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = ""; + if (documentDescriptorCase_ == 6) { + ref = documentDescriptor_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (documentDescriptorCase_ == 6) { + documentDescriptor_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document] URI - only
+     * allowed for website data stores.
+     * 
+ * + * string uri = 6; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + documentDescriptorCase_ = 6; + documentDescriptor_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document] URI - only
+     * allowed for website data stores.
+     * 
+ * + * string uri = 6; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + if (documentDescriptorCase_ == 6) { + documentDescriptorCase_ = 0; + documentDescriptor_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document] URI - only
+     * allowed for website data stores.
+     * 
+ * + * string uri = 6; + * + * @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); + documentDescriptorCase_ = 6; + documentDescriptor_ = value; + onChanged(); + return this; + } + + private int quantity_; + /** + * + * + *
+     * Quantity of the Document associated with the user event. Defaults to 1.
+     *
+     * For example, this field will be 2 if two quantities of the same Document
+     * are involved in a `add-to-cart` event.
+     *
+     * Required for events of the following event types:
+     *
+     * * `add-to-cart`
+     * * `purchase`
+     * 
+ * + * optional int32 quantity = 3; + * + * @return Whether the quantity field is set. + */ + @java.lang.Override + public boolean hasQuantity() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Quantity of the Document associated with the user event. Defaults to 1.
+     *
+     * For example, this field will be 2 if two quantities of the same Document
+     * are involved in a `add-to-cart` event.
+     *
+     * Required for events of the following event types:
+     *
+     * * `add-to-cart`
+     * * `purchase`
+     * 
+ * + * optional int32 quantity = 3; + * + * @return The quantity. + */ + @java.lang.Override + public int getQuantity() { + return quantity_; + } + /** + * + * + *
+     * Quantity of the Document associated with the user event. Defaults to 1.
+     *
+     * For example, this field will be 2 if two quantities of the same Document
+     * are involved in a `add-to-cart` event.
+     *
+     * Required for events of the following event types:
+     *
+     * * `add-to-cart`
+     * * `purchase`
+     * 
+ * + * optional int32 quantity = 3; + * + * @param value The quantity to set. + * @return This builder for chaining. + */ + public Builder setQuantity(int value) { + + quantity_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Quantity of the Document associated with the user event. Defaults to 1.
+     *
+     * For example, this field will be 2 if two quantities of the same Document
+     * are involved in a `add-to-cart` event.
+     *
+     * Required for events of the following event types:
+     *
+     * * `add-to-cart`
+     * * `purchase`
+     * 
+ * + * optional int32 quantity = 3; + * + * @return This builder for chaining. + */ + public Builder clearQuantity() { + bitField0_ = (bitField0_ & ~0x00000008); + quantity_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList promotionIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensurePromotionIdsIsMutable() { + if (!promotionIds_.isModifiable()) { + promotionIds_ = new com.google.protobuf.LazyStringArrayList(promotionIds_); + } + bitField0_ |= 0x00000010; + } + /** + * + * + *
+     * The promotion IDs associated with this Document.
+     * Currently, this field is restricted to at most one ID.
+     * 
+ * + * repeated string promotion_ids = 4; + * + * @return A list containing the promotionIds. + */ + public com.google.protobuf.ProtocolStringList getPromotionIdsList() { + promotionIds_.makeImmutable(); + return promotionIds_; + } + /** + * + * + *
+     * The promotion IDs associated with this Document.
+     * Currently, this field is restricted to at most one ID.
+     * 
+ * + * repeated string promotion_ids = 4; + * + * @return The count of promotionIds. + */ + public int getPromotionIdsCount() { + return promotionIds_.size(); + } + /** + * + * + *
+     * The promotion IDs associated with this Document.
+     * Currently, this field is restricted to at most one ID.
+     * 
+ * + * repeated string promotion_ids = 4; + * + * @param index The index of the element to return. + * @return The promotionIds at the given index. + */ + public java.lang.String getPromotionIds(int index) { + return promotionIds_.get(index); + } + /** + * + * + *
+     * The promotion IDs associated with this Document.
+     * Currently, this field is restricted to at most one ID.
+     * 
+ * + * repeated string promotion_ids = 4; + * + * @param index The index of the value to return. + * @return The bytes of the promotionIds at the given index. + */ + public com.google.protobuf.ByteString getPromotionIdsBytes(int index) { + return promotionIds_.getByteString(index); + } + /** + * + * + *
+     * The promotion IDs associated with this Document.
+     * Currently, this field is restricted to at most one ID.
+     * 
+ * + * repeated string promotion_ids = 4; + * + * @param index The index to set the value at. + * @param value The promotionIds to set. + * @return This builder for chaining. + */ + public Builder setPromotionIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePromotionIdsIsMutable(); + promotionIds_.set(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The promotion IDs associated with this Document.
+     * Currently, this field is restricted to at most one ID.
+     * 
+ * + * repeated string promotion_ids = 4; + * + * @param value The promotionIds to add. + * @return This builder for chaining. + */ + public Builder addPromotionIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePromotionIdsIsMutable(); + promotionIds_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The promotion IDs associated with this Document.
+     * Currently, this field is restricted to at most one ID.
+     * 
+ * + * repeated string promotion_ids = 4; + * + * @param values The promotionIds to add. + * @return This builder for chaining. + */ + public Builder addAllPromotionIds(java.lang.Iterable values) { + ensurePromotionIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, promotionIds_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The promotion IDs associated with this Document.
+     * Currently, this field is restricted to at most one ID.
+     * 
+ * + * repeated string promotion_ids = 4; + * + * @return This builder for chaining. + */ + public Builder clearPromotionIds() { + promotionIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * The promotion IDs associated with this Document.
+     * Currently, this field is restricted to at most one ID.
+     * 
+ * + * repeated string promotion_ids = 4; + * + * @param value The bytes of the promotionIds to add. + * @return This builder for chaining. + */ + public Builder addPromotionIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePromotionIdsIsMutable(); + promotionIds_.add(value); + bitField0_ |= 0x00000010; + 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.discoveryengine.v1alpha.DocumentInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.DocumentInfo) + private static final com.google.cloud.discoveryengine.v1alpha.DocumentInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.DocumentInfo(); + } + + public static com.google.cloud.discoveryengine.v1alpha.DocumentInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DocumentInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentInfoOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentInfoOrBuilder.java new file mode 100644 index 000000000000..a4f06a343d5b --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentInfoOrBuilder.java @@ -0,0 +1,247 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/user_event.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface DocumentInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.DocumentInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+   * ID.
+   * 
+ * + * string id = 1; + * + * @return Whether the id field is set. + */ + boolean hasId(); + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+   * ID.
+   * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+   * ID.
+   * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+   * full name, of the form:
+   * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
+   * 
+ * + * string name = 2 [(.google.api.resource_reference) = { ... } + * + * @return Whether the name field is set. + */ + boolean hasName(); + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+   * full name, of the form:
+   * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
+   * 
+ * + * string name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
+   * full name, of the form:
+   * `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
+   * 
+ * + * string name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document] URI - only
+   * allowed for website data stores.
+   * 
+ * + * string uri = 6; + * + * @return Whether the uri field is set. + */ + boolean hasUri(); + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document] URI - only
+   * allowed for website data stores.
+   * 
+ * + * string uri = 6; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document] URI - only
+   * allowed for website data stores.
+   * 
+ * + * string uri = 6; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * Quantity of the Document associated with the user event. Defaults to 1.
+   *
+   * For example, this field will be 2 if two quantities of the same Document
+   * are involved in a `add-to-cart` event.
+   *
+   * Required for events of the following event types:
+   *
+   * * `add-to-cart`
+   * * `purchase`
+   * 
+ * + * optional int32 quantity = 3; + * + * @return Whether the quantity field is set. + */ + boolean hasQuantity(); + /** + * + * + *
+   * Quantity of the Document associated with the user event. Defaults to 1.
+   *
+   * For example, this field will be 2 if two quantities of the same Document
+   * are involved in a `add-to-cart` event.
+   *
+   * Required for events of the following event types:
+   *
+   * * `add-to-cart`
+   * * `purchase`
+   * 
+ * + * optional int32 quantity = 3; + * + * @return The quantity. + */ + int getQuantity(); + + /** + * + * + *
+   * The promotion IDs associated with this Document.
+   * Currently, this field is restricted to at most one ID.
+   * 
+ * + * repeated string promotion_ids = 4; + * + * @return A list containing the promotionIds. + */ + java.util.List getPromotionIdsList(); + /** + * + * + *
+   * The promotion IDs associated with this Document.
+   * Currently, this field is restricted to at most one ID.
+   * 
+ * + * repeated string promotion_ids = 4; + * + * @return The count of promotionIds. + */ + int getPromotionIdsCount(); + /** + * + * + *
+   * The promotion IDs associated with this Document.
+   * Currently, this field is restricted to at most one ID.
+   * 
+ * + * repeated string promotion_ids = 4; + * + * @param index The index of the element to return. + * @return The promotionIds at the given index. + */ + java.lang.String getPromotionIds(int index); + /** + * + * + *
+   * The promotion IDs associated with this Document.
+   * Currently, this field is restricted to at most one ID.
+   * 
+ * + * repeated string promotion_ids = 4; + * + * @param index The index of the value to return. + * @return The bytes of the promotionIds at the given index. + */ + com.google.protobuf.ByteString getPromotionIdsBytes(int index); + + com.google.cloud.discoveryengine.v1alpha.DocumentInfo.DocumentDescriptorCase + getDocumentDescriptorCase(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentName.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentName.java new file mode 100644 index 000000000000..183e5f4c4d18 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentName.java @@ -0,0 +1,485 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +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 DocumentName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_DATA_STORE_BRANCH_DOCUMENT = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}"); + private static final PathTemplate PROJECT_LOCATION_COLLECTION_DATA_STORE_BRANCH_DOCUMENT = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String dataStore; + private final String branch; + private final String document; + private final String collection; + + @Deprecated + protected DocumentName() { + project = null; + location = null; + dataStore = null; + branch = null; + document = null; + collection = null; + } + + private DocumentName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + dataStore = Preconditions.checkNotNull(builder.getDataStore()); + branch = Preconditions.checkNotNull(builder.getBranch()); + document = Preconditions.checkNotNull(builder.getDocument()); + collection = null; + pathTemplate = PROJECT_LOCATION_DATA_STORE_BRANCH_DOCUMENT; + } + + private DocumentName(ProjectLocationCollectionDataStoreBranchDocumentBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + collection = Preconditions.checkNotNull(builder.getCollection()); + dataStore = Preconditions.checkNotNull(builder.getDataStore()); + branch = Preconditions.checkNotNull(builder.getBranch()); + document = Preconditions.checkNotNull(builder.getDocument()); + pathTemplate = PROJECT_LOCATION_COLLECTION_DATA_STORE_BRANCH_DOCUMENT; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataStore() { + return dataStore; + } + + public String getBranch() { + return branch; + } + + public String getDocument() { + return document; + } + + public String getCollection() { + return collection; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectLocationDataStoreBranchDocumentBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static ProjectLocationCollectionDataStoreBranchDocumentBuilder + newProjectLocationCollectionDataStoreBranchDocumentBuilder() { + return new ProjectLocationCollectionDataStoreBranchDocumentBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static DocumentName of( + String project, String location, String dataStore, String branch, String document) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setBranch(branch) + .setDocument(document) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static DocumentName ofProjectLocationDataStoreBranchDocumentName( + String project, String location, String dataStore, String branch, String document) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setBranch(branch) + .setDocument(document) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static DocumentName ofProjectLocationCollectionDataStoreBranchDocumentName( + String project, + String location, + String collection, + String dataStore, + String branch, + String document) { + return newProjectLocationCollectionDataStoreBranchDocumentBuilder() + .setProject(project) + .setLocation(location) + .setCollection(collection) + .setDataStore(dataStore) + .setBranch(branch) + .setDocument(document) + .build(); + } + + public static String format( + String project, String location, String dataStore, String branch, String document) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setBranch(branch) + .setDocument(document) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationDataStoreBranchDocumentName( + String project, String location, String dataStore, String branch, String document) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setBranch(branch) + .setDocument(document) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationCollectionDataStoreBranchDocumentName( + String project, + String location, + String collection, + String dataStore, + String branch, + String document) { + return newProjectLocationCollectionDataStoreBranchDocumentBuilder() + .setProject(project) + .setLocation(location) + .setCollection(collection) + .setDataStore(dataStore) + .setBranch(branch) + .setDocument(document) + .build() + .toString(); + } + + public static DocumentName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_DATA_STORE_BRANCH_DOCUMENT.matches(formattedString)) { + Map matchMap = + PROJECT_LOCATION_DATA_STORE_BRANCH_DOCUMENT.match(formattedString); + return ofProjectLocationDataStoreBranchDocumentName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("data_store"), + matchMap.get("branch"), + matchMap.get("document")); + } else if (PROJECT_LOCATION_COLLECTION_DATA_STORE_BRANCH_DOCUMENT.matches(formattedString)) { + Map matchMap = + PROJECT_LOCATION_COLLECTION_DATA_STORE_BRANCH_DOCUMENT.match(formattedString); + return ofProjectLocationCollectionDataStoreBranchDocumentName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("collection"), + matchMap.get("data_store"), + matchMap.get("branch"), + matchMap.get("document")); + } + throw new ValidationException("DocumentName.parse: formattedString not in valid format"); + } + + 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 (DocumentName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_DATA_STORE_BRANCH_DOCUMENT.matches(formattedString) + || PROJECT_LOCATION_COLLECTION_DATA_STORE_BRANCH_DOCUMENT.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 (dataStore != null) { + fieldMapBuilder.put("data_store", dataStore); + } + if (branch != null) { + fieldMapBuilder.put("branch", branch); + } + if (document != null) { + fieldMapBuilder.put("document", document); + } + if (collection != null) { + fieldMapBuilder.put("collection", collection); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + DocumentName that = ((DocumentName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.dataStore, that.dataStore) + && Objects.equals(this.branch, that.branch) + && Objects.equals(this.document, that.document) + && Objects.equals(this.collection, that.collection); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(dataStore); + h *= 1000003; + h ^= Objects.hashCode(branch); + h *= 1000003; + h ^= Objects.hashCode(document); + h *= 1000003; + h ^= Objects.hashCode(collection); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}. + */ + public static class Builder { + private String project; + private String location; + private String dataStore; + private String branch; + private String document; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataStore() { + return dataStore; + } + + public String getBranch() { + return branch; + } + + public String getDocument() { + return document; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setDataStore(String dataStore) { + this.dataStore = dataStore; + return this; + } + + public Builder setBranch(String branch) { + this.branch = branch; + return this; + } + + public Builder setDocument(String document) { + this.document = document; + return this; + } + + private Builder(DocumentName documentName) { + Preconditions.checkArgument( + Objects.equals(documentName.pathTemplate, PROJECT_LOCATION_DATA_STORE_BRANCH_DOCUMENT), + "toBuilder is only supported when DocumentName has the pattern of projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}"); + this.project = documentName.project; + this.location = documentName.location; + this.dataStore = documentName.dataStore; + this.branch = documentName.branch; + this.document = documentName.document; + } + + public DocumentName build() { + return new DocumentName(this); + } + } + + /** + * Builder for + * projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}. + */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class ProjectLocationCollectionDataStoreBranchDocumentBuilder { + private String project; + private String location; + private String collection; + private String dataStore; + private String branch; + private String document; + + protected ProjectLocationCollectionDataStoreBranchDocumentBuilder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCollection() { + return collection; + } + + public String getDataStore() { + return dataStore; + } + + public String getBranch() { + return branch; + } + + public String getDocument() { + return document; + } + + public ProjectLocationCollectionDataStoreBranchDocumentBuilder setProject(String project) { + this.project = project; + return this; + } + + public ProjectLocationCollectionDataStoreBranchDocumentBuilder setLocation(String location) { + this.location = location; + return this; + } + + public ProjectLocationCollectionDataStoreBranchDocumentBuilder setCollection( + String collection) { + this.collection = collection; + return this; + } + + public ProjectLocationCollectionDataStoreBranchDocumentBuilder setDataStore(String dataStore) { + this.dataStore = dataStore; + return this; + } + + public ProjectLocationCollectionDataStoreBranchDocumentBuilder setBranch(String branch) { + this.branch = branch; + return this; + } + + public ProjectLocationCollectionDataStoreBranchDocumentBuilder setDocument(String document) { + this.document = document; + return this; + } + + public DocumentName build() { + return new DocumentName(this); + } + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentOrBuilder.java new file mode 100644 index 000000000000..0aa4f9433955 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentOrBuilder.java @@ -0,0 +1,320 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/document.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface DocumentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.Document) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The structured JSON data for the document. It should conform to the
+   * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
+   * 
+ * + * .google.protobuf.Struct struct_data = 4; + * + * @return Whether the structData field is set. + */ + boolean hasStructData(); + /** + * + * + *
+   * The structured JSON data for the document. It should conform to the
+   * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
+   * 
+ * + * .google.protobuf.Struct struct_data = 4; + * + * @return The structData. + */ + com.google.protobuf.Struct getStructData(); + /** + * + * + *
+   * The structured JSON data for the document. It should conform to the
+   * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
+   * 
+ * + * .google.protobuf.Struct struct_data = 4; + */ + com.google.protobuf.StructOrBuilder getStructDataOrBuilder(); + + /** + * + * + *
+   * The JSON string representation of the document. It should conform to the
+   * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
+   * 
+ * + * string json_data = 5; + * + * @return Whether the jsonData field is set. + */ + boolean hasJsonData(); + /** + * + * + *
+   * The JSON string representation of the document. It should conform to the
+   * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
+   * 
+ * + * string json_data = 5; + * + * @return The jsonData. + */ + java.lang.String getJsonData(); + /** + * + * + *
+   * The JSON string representation of the document. It should conform to the
+   * registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an
+   * `INVALID_ARGUMENT` error is thrown.
+   * 
+ * + * string json_data = 5; + * + * @return The bytes for jsonData. + */ + com.google.protobuf.ByteString getJsonDataBytes(); + + /** + * + * + *
+   * Immutable. The full resource name of the document.
+   * Format:
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`.
+   *
+   * This field must be a UTF-8 encoded string with a length limit of 1024
+   * characters.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. The full resource name of the document.
+   * Format:
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`.
+   *
+   * This field must be a UTF-8 encoded string with a length limit of 1024
+   * characters.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Immutable. The identifier of the document.
+   *
+   * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+   * standard with a length limit of 63 characters.
+   * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+   * Immutable. The identifier of the document.
+   *
+   * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+   * standard with a length limit of 63 characters.
+   * 
+ * + * string id = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+   * The identifier of the schema located in the same data store.
+   * 
+ * + * string schema_id = 3; + * + * @return The schemaId. + */ + java.lang.String getSchemaId(); + /** + * + * + *
+   * The identifier of the schema located in the same data store.
+   * 
+ * + * string schema_id = 3; + * + * @return The bytes for schemaId. + */ + com.google.protobuf.ByteString getSchemaIdBytes(); + + /** + * + * + *
+   * The unstructured data linked to this document. Content must be set if this
+   * document is under a
+   * `CONTENT_REQUIRED` data store.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document.Content content = 10; + * + * @return Whether the content field is set. + */ + boolean hasContent(); + /** + * + * + *
+   * The unstructured data linked to this document. Content must be set if this
+   * document is under a
+   * `CONTENT_REQUIRED` data store.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document.Content content = 10; + * + * @return The content. + */ + com.google.cloud.discoveryengine.v1alpha.Document.Content getContent(); + /** + * + * + *
+   * The unstructured data linked to this document. Content must be set if this
+   * document is under a
+   * `CONTENT_REQUIRED` data store.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document.Content content = 10; + */ + com.google.cloud.discoveryengine.v1alpha.Document.ContentOrBuilder getContentOrBuilder(); + + /** + * + * + *
+   * The identifier of the parent document. Currently supports at most two level
+   * document hierarchy.
+   *
+   * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+   * standard with a length limit of 63 characters.
+   * 
+ * + * string parent_document_id = 7; + * + * @return The parentDocumentId. + */ + java.lang.String getParentDocumentId(); + /** + * + * + *
+   * The identifier of the parent document. Currently supports at most two level
+   * document hierarchy.
+   *
+   * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
+   * standard with a length limit of 63 characters.
+   * 
+ * + * string parent_document_id = 7; + * + * @return The bytes for parentDocumentId. + */ + com.google.protobuf.ByteString getParentDocumentIdBytes(); + + /** + * + * + *
+   * Output only. This field is OUTPUT_ONLY.
+   * It contains derived data that are not in the original input document.
+   * 
+ * + * + * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the derivedStructData field is set. + */ + boolean hasDerivedStructData(); + /** + * + * + *
+   * Output only. This field is OUTPUT_ONLY.
+   * It contains derived data that are not in the original input document.
+   * 
+ * + * + * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The derivedStructData. + */ + com.google.protobuf.Struct getDerivedStructData(); + /** + * + * + *
+   * Output only. This field is OUTPUT_ONLY.
+   * It contains derived data that are not in the original input document.
+   * 
+ * + * + * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.StructOrBuilder getDerivedStructDataOrBuilder(); + + com.google.cloud.discoveryengine.v1alpha.Document.DataCase getDataCase(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentProto.java new file mode 100644 index 000000000000..b5c327f66c0c --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentProto.java @@ -0,0 +1,123 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/document.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public final class DocumentProto { + private DocumentProto() {} + + 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_discoveryengine_v1alpha_Document_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_Document_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_Document_Content_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_Document_Content_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/discoveryengine/v1alpha/d" + + "ocument.proto\022$google.cloud.discoveryeng" + + "ine.v1alpha\032\037google/api/field_behavior.p" + + "roto\032\031google/api/resource.proto\032\034google/" + + "protobuf/struct.proto\"\227\005\n\010Document\022.\n\013st" + + "ruct_data\030\004 \001(\0132\027.google.protobuf.Struct" + + "H\000\022\023\n\tjson_data\030\005 \001(\tH\000\022\022\n\004name\030\001 \001(\tB\004\342" + + "A\001\005\022\020\n\002id\030\002 \001(\tB\004\342A\001\005\022\021\n\tschema_id\030\003 \001(\t" + + "\022G\n\007content\030\n \001(\01326.google.cloud.discove" + + "ryengine.v1alpha.Document.Content\022\032\n\022par" + + "ent_document_id\030\007 \001(\t\022:\n\023derived_struct_" + + "data\030\006 \001(\0132\027.google.protobuf.StructB\004\342A\001" + + "\003\032K\n\007Content\022\023\n\traw_bytes\030\002 \001(\014H\000\022\r\n\003uri" + + "\030\003 \001(\tH\000\022\021\n\tmime_type\030\001 \001(\tB\t\n\007content:\226" + + "\002\352A\222\002\n\'discoveryengine.googleapis.com/Do" + + "cument\022fprojects/{project}/locations/{lo" + + "cation}/dataStores/{data_store}/branches" + + "/{branch}/documents/{document}\022\177projects" + + "/{project}/locations/{location}/collecti" + + "ons/{collection}/dataStores/{data_store}" + + "/branches/{branch}/documents/{document}B" + + "\006\n\004dataB\231\002\n(com.google.cloud.discoveryen" + + "gine.v1alphaB\rDocumentProtoP\001ZRcloud.goo" + + "gle.com/go/discoveryengine/apiv1alpha/di" + + "scoveryenginepb;discoveryenginepb\242\002\017DISC" + + "OVERYENGINE\252\002$Google.Cloud.DiscoveryEngi" + + "ne.V1Alpha\312\002$Google\\Cloud\\DiscoveryEngin" + + "e\\V1alpha\352\002\'Google::Cloud::DiscoveryEngi" + + "ne::V1alphab\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.StructProto.getDescriptor(), + }); + internal_static_google_cloud_discoveryengine_v1alpha_Document_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_discoveryengine_v1alpha_Document_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_Document_descriptor, + new java.lang.String[] { + "StructData", + "JsonData", + "Name", + "Id", + "SchemaId", + "Content", + "ParentDocumentId", + "DerivedStructData", + "Data", + }); + internal_static_google_cloud_discoveryengine_v1alpha_Document_Content_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_Document_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1alpha_Document_Content_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_Document_Content_descriptor, + new java.lang.String[] { + "RawBytes", "Uri", "MimeType", "Content", + }); + 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.protobuf.StructProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceProto.java new file mode 100644 index 000000000000..a009c67d79eb --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DocumentServiceProto.java @@ -0,0 +1,251 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/document_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public final class DocumentServiceProto { + private DocumentServiceProto() {} + + 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_discoveryengine_v1alpha_GetDocumentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_GetDocumentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_ListDocumentsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_ListDocumentsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_ListDocumentsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_ListDocumentsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_CreateDocumentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_CreateDocumentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_UpdateDocumentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_UpdateDocumentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_DeleteDocumentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_DeleteDocumentRequest_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/discoveryengine/v1alpha/d" + + "ocument_service.proto\022$google.cloud.disc" + + "overyengine.v1alpha\032\034google/api/annotati" + + "ons.proto\032\027google/api/client.proto\032\037goog" + + "le/api/field_behavior.proto\032\031google/api/" + + "resource.proto\0323google/cloud/discoveryen" + + "gine/v1alpha/document.proto\0328google/clou" + + "d/discoveryengine/v1alpha/import_config." + + "proto\0327google/cloud/discoveryengine/v1al" + + "pha/purge_config.proto\032#google/longrunni" + + "ng/operations.proto\032\033google/protobuf/emp" + + "ty.proto\"T\n\022GetDocumentRequest\022>\n\004name\030\001" + + " \001(\tB0\342A\001\002\372A)\n\'discoveryengine.googleapi" + + "s.com/Document\"}\n\024ListDocumentsRequest\022>" + + "\n\006parent\030\001 \001(\tB.\342A\001\002\372A\'\n%discoveryengine" + + ".googleapis.com/Branch\022\021\n\tpage_size\030\002 \001(" + + "\005\022\022\n\npage_token\030\003 \001(\t\"s\n\025ListDocumentsRe" + + "sponse\022A\n\tdocuments\030\001 \003(\0132..google.cloud" + + ".discoveryengine.v1alpha.Document\022\027\n\017nex" + + "t_page_token\030\002 \001(\t\"\272\001\n\025CreateDocumentReq" + + "uest\022>\n\006parent\030\001 \001(\tB.\342A\001\002\372A\'\n%discovery" + + "engine.googleapis.com/Branch\022F\n\010document" + + "\030\002 \001(\0132..google.cloud.discoveryengine.v1" + + "alpha.DocumentB\004\342A\001\002\022\031\n\013document_id\030\003 \001(" + + "\tB\004\342A\001\002\"v\n\025UpdateDocumentRequest\022F\n\010docu" + + "ment\030\001 \001(\0132..google.cloud.discoveryengin" + + "e.v1alpha.DocumentB\004\342A\001\002\022\025\n\rallow_missin" + + "g\030\002 \001(\010\"W\n\025DeleteDocumentRequest\022>\n\004name" + + "\030\001 \001(\tB0\342A\001\002\372A)\n\'discoveryengine.googlea" + + "pis.com/Document2\241\024\n\017DocumentService\022\260\002\n" + + "\013GetDocument\0228.google.cloud.discoveryeng" + + "ine.v1alpha.GetDocumentRequest\032..google." + + "cloud.discoveryengine.v1alpha.Document\"\266" + + "\001\332A\004name\202\323\344\223\002\250\001\022J/v1alpha/{name=projects" + + "/*/locations/*/dataStores/*/branches/*/d" + + "ocuments/*}ZZ\022X/v1alpha/{name=projects/*" + + "/locations/*/collections/*/dataStores/*/" + + "branches/*/documents/*}\022\303\002\n\rListDocument" + + "s\022:.google.cloud.discoveryengine.v1alpha" + + ".ListDocumentsRequest\032;.google.cloud.dis" + + "coveryengine.v1alpha.ListDocumentsRespon" + + "se\"\270\001\332A\006parent\202\323\344\223\002\250\001\022J/v1alpha/{parent=" + + "projects/*/locations/*/dataStores/*/bran" + + "ches/*}/documentsZZ\022X/v1alpha/{parent=pr" + + "ojects/*/locations/*/collections/*/dataS" + + "tores/*/branches/*}/documents\022\341\002\n\016Create" + + "Document\022;.google.cloud.discoveryengine." + + "v1alpha.CreateDocumentRequest\032..google.c" + + "loud.discoveryengine.v1alpha.Document\"\341\001" + + "\332A\033parent,document,document_id\202\323\344\223\002\274\001\"J/" + + "v1alpha/{parent=projects/*/locations/*/d" + + "ataStores/*/branches/*}/documents:\010docum" + + "entZd\"X/v1alpha/{parent=projects/*/locat" + + "ions/*/collections/*/dataStores/*/branch" + + "es/*}/documents:\010document\022\325\002\n\016UpdateDocu" + + "ment\022;.google.cloud.discoveryengine.v1al" + + "pha.UpdateDocumentRequest\032..google.cloud" + + ".discoveryengine.v1alpha.Document\"\325\001\202\323\344\223" + + "\002\316\0012S/v1alpha/{document.name=projects/*/" + + "locations/*/dataStores/*/branches/*/docu" + + "ments/*}:\010documentZm2a/v1alpha/{document" + + ".name=projects/*/locations/*/collections" + + "/*/dataStores/*/branches/*/documents/*}:" + + "\010document\022\236\002\n\016DeleteDocument\022;.google.cl" + + "oud.discoveryengine.v1alpha.DeleteDocume" + + "ntRequest\032\026.google.protobuf.Empty\"\266\001\332A\004n" + + "ame\202\323\344\223\002\250\001*J/v1alpha/{name=projects/*/lo" + + "cations/*/dataStores/*/branches/*/docume" + + "nts/*}ZZ*X/v1alpha/{name=projects/*/loca" + + "tions/*/collections/*/dataStores/*/branc" + + "hes/*/documents/*}\022\263\003\n\017ImportDocuments\022<" + + ".google.cloud.discoveryengine.v1alpha.Im" + + "portDocumentsRequest\032\035.google.longrunnin" + + "g.Operation\"\302\002\312A|\n + * Double list. + * + * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.DoubleList} + */ +public final class DoubleList extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.DoubleList) + DoubleListOrBuilder { + private static final long serialVersionUID = 0L; + // Use DoubleList.newBuilder() to construct. + private DoubleList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DoubleList() { + values_ = emptyDoubleList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DoubleList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.CommonProto + .internal_static_google_cloud_discoveryengine_v1alpha_DoubleList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.CommonProto + .internal_static_google_cloud_discoveryengine_v1alpha_DoubleList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.DoubleList.class, + com.google.cloud.discoveryengine.v1alpha.DoubleList.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.DoubleList values_; + /** + * + * + *
+   * Double values.
+   * 
+ * + * repeated double values = 1; + * + * @return A list containing the values. + */ + @java.lang.Override + public java.util.List getValuesList() { + return values_; + } + /** + * + * + *
+   * Double values.
+   * 
+ * + * repeated double values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+   * Double values.
+   * 
+ * + * repeated double values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public double getValues(int index) { + return values_.getDouble(index); + } + + private int valuesMemoizedSerializedSize = -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 (getValuesList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(valuesMemoizedSerializedSize); + } + for (int i = 0; i < values_.size(); i++) { + output.writeDoubleNoTag(values_.getDouble(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + dataSize = 8 * getValuesList().size(); + size += dataSize; + if (!getValuesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + valuesMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.DoubleList)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.DoubleList other = + (com.google.cloud.discoveryengine.v1alpha.DoubleList) obj; + + if (!getValuesList().equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.DoubleList parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.DoubleList parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DoubleList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.DoubleList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DoubleList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.DoubleList parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DoubleList parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.DoubleList parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DoubleList parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.DoubleList parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.DoubleList parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.DoubleList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.discoveryengine.v1alpha.DoubleList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Double list.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.DoubleList} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.DoubleList) + com.google.cloud.discoveryengine.v1alpha.DoubleListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.CommonProto + .internal_static_google_cloud_discoveryengine_v1alpha_DoubleList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.CommonProto + .internal_static_google_cloud_discoveryengine_v1alpha_DoubleList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.DoubleList.class, + com.google.cloud.discoveryengine.v1alpha.DoubleList.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.DoubleList.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + values_ = emptyDoubleList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.CommonProto + .internal_static_google_cloud_discoveryengine_v1alpha_DoubleList_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DoubleList getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.DoubleList.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DoubleList build() { + com.google.cloud.discoveryengine.v1alpha.DoubleList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DoubleList buildPartial() { + com.google.cloud.discoveryengine.v1alpha.DoubleList result = + new com.google.cloud.discoveryengine.v1alpha.DoubleList(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.DoubleList result) { + if (((bitField0_ & 0x00000001) != 0)) { + values_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.DoubleList result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.DoubleList) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.DoubleList) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.DoubleList other) { + if (other == com.google.cloud.discoveryengine.v1alpha.DoubleList.getDefaultInstance()) + return this; + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: + { + double v = input.readDouble(); + ensureValuesIsMutable(); + values_.addDouble(v); + break; + } // case 9 + case 10: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValuesIsMutable(); + while (input.getBytesUntilLimit() > 0) { + values_.addDouble(input.readDouble()); + } + input.popLimit(limit); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Internal.DoubleList values_ = emptyDoubleList(); + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = mutableCopy(values_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Double values.
+     * 
+ * + * repeated double values = 1; + * + * @return A list containing the values. + */ + public java.util.List getValuesList() { + return ((bitField0_ & 0x00000001) != 0) + ? java.util.Collections.unmodifiableList(values_) + : values_; + } + /** + * + * + *
+     * Double values.
+     * 
+ * + * repeated double values = 1; + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+     * Double values.
+     * 
+ * + * repeated double values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public double getValues(int index) { + return values_.getDouble(index); + } + /** + * + * + *
+     * Double values.
+     * 
+ * + * repeated double values = 1; + * + * @param index The index to set the value at. + * @param value The values to set. + * @return This builder for chaining. + */ + public Builder setValues(int index, double value) { + + ensureValuesIsMutable(); + values_.setDouble(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Double values.
+     * 
+ * + * repeated double values = 1; + * + * @param value The values to add. + * @return This builder for chaining. + */ + public Builder addValues(double value) { + + ensureValuesIsMutable(); + values_.addDouble(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Double values.
+     * 
+ * + * repeated double values = 1; + * + * @param values The values to add. + * @return This builder for chaining. + */ + public Builder addAllValues(java.lang.Iterable values) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + onChanged(); + return this; + } + /** + * + * + *
+     * Double values.
+     * 
+ * + * repeated double values = 1; + * + * @return This builder for chaining. + */ + public Builder clearValues() { + values_ = emptyDoubleList(); + 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.discoveryengine.v1alpha.DoubleList) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.DoubleList) + private static final com.google.cloud.discoveryengine.v1alpha.DoubleList DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.DoubleList(); + } + + public static com.google.cloud.discoveryengine.v1alpha.DoubleList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DoubleList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DoubleList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DoubleListOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DoubleListOrBuilder.java new file mode 100644 index 000000000000..64cbfb38c505 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/DoubleListOrBuilder.java @@ -0,0 +1,63 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/common.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface DoubleListOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.DoubleList) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Double values.
+   * 
+ * + * repeated double values = 1; + * + * @return A list containing the values. + */ + java.util.List getValuesList(); + /** + * + * + *
+   * Double values.
+   * 
+ * + * repeated double values = 1; + * + * @return The count of values. + */ + int getValuesCount(); + /** + * + * + *
+   * Double values.
+   * 
+ * + * repeated double values = 1; + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + double getValues(int index); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/FieldConfig.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/FieldConfig.java new file mode 100644 index 000000000000..63f8a6512c8f --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/FieldConfig.java @@ -0,0 +1,4108 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Configurations for fields of a schema. For example, configuring a field is
+ * indexable, or searchable.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.FieldConfig} + */ +public final class FieldConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.FieldConfig) + FieldConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use FieldConfig.newBuilder() to construct. + private FieldConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FieldConfig() { + fieldPath_ = ""; + fieldType_ = 0; + indexableOption_ = 0; + dynamicFacetableOption_ = 0; + searchableOption_ = 0; + retrievableOption_ = 0; + completableOption_ = 0; + recsFilterableOption_ = 0; + keyPropertyType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FieldConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaProto + .internal_static_google_cloud_discoveryengine_v1alpha_FieldConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SchemaProto + .internal_static_google_cloud_discoveryengine_v1alpha_FieldConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.FieldConfig.class, + com.google.cloud.discoveryengine.v1alpha.FieldConfig.Builder.class); + } + + /** + * + * + *
+   * Field value type in the Schema.
+   * 
+ * + * Protobuf enum {@code google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType} + */ + public enum FieldType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Field type is unspecified.
+     * 
+ * + * FIELD_TYPE_UNSPECIFIED = 0; + */ + FIELD_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Field value type is Object.
+     * 
+ * + * OBJECT = 1; + */ + OBJECT(1), + /** + * + * + *
+     * Field value type is String.
+     * 
+ * + * STRING = 2; + */ + STRING(2), + /** + * + * + *
+     * Field value type is Number.
+     * 
+ * + * NUMBER = 3; + */ + NUMBER(3), + /** + * + * + *
+     * Field value type is Integer.
+     * 
+ * + * INTEGER = 4; + */ + INTEGER(4), + /** + * + * + *
+     * Field value type is Boolean.
+     * 
+ * + * BOOLEAN = 5; + */ + BOOLEAN(5), + /** + * + * + *
+     * Field value type is Geolocation.
+     * 
+ * + * GEOLOCATION = 6; + */ + GEOLOCATION(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Field type is unspecified.
+     * 
+ * + * FIELD_TYPE_UNSPECIFIED = 0; + */ + public static final int FIELD_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Field value type is Object.
+     * 
+ * + * OBJECT = 1; + */ + public static final int OBJECT_VALUE = 1; + /** + * + * + *
+     * Field value type is String.
+     * 
+ * + * STRING = 2; + */ + public static final int STRING_VALUE = 2; + /** + * + * + *
+     * Field value type is Number.
+     * 
+ * + * NUMBER = 3; + */ + public static final int NUMBER_VALUE = 3; + /** + * + * + *
+     * Field value type is Integer.
+     * 
+ * + * INTEGER = 4; + */ + public static final int INTEGER_VALUE = 4; + /** + * + * + *
+     * Field value type is Boolean.
+     * 
+ * + * BOOLEAN = 5; + */ + public static final int BOOLEAN_VALUE = 5; + /** + * + * + *
+     * Field value type is Geolocation.
+     * 
+ * + * GEOLOCATION = 6; + */ + public static final int GEOLOCATION_VALUE = 6; + + 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 FieldType 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 FieldType forNumber(int value) { + switch (value) { + case 0: + return FIELD_TYPE_UNSPECIFIED; + case 1: + return OBJECT; + case 2: + return STRING; + case 3: + return NUMBER; + case 4: + return INTEGER; + case 5: + return BOOLEAN; + case 6: + return GEOLOCATION; + 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 FieldType findValueByNumber(int number) { + return FieldType.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.discoveryengine.v1alpha.FieldConfig.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final FieldType[] VALUES = values(); + + public static FieldType 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 FieldType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType) + } + + /** + * + * + *
+   * The setting of Indexable options in schema.
+   * 
+ * + * Protobuf enum {@code google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption} + */ + public enum IndexableOption implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Value used when unset.
+     * 
+ * + * INDEXABLE_OPTION_UNSPECIFIED = 0; + */ + INDEXABLE_OPTION_UNSPECIFIED(0), + /** + * + * + *
+     * Indexable option enabled for a schema field.
+     * 
+ * + * INDEXABLE_ENABLED = 1; + */ + INDEXABLE_ENABLED(1), + /** + * + * + *
+     * Indexable option disabled for a schema field.
+     * 
+ * + * INDEXABLE_DISABLED = 2; + */ + INDEXABLE_DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Value used when unset.
+     * 
+ * + * INDEXABLE_OPTION_UNSPECIFIED = 0; + */ + public static final int INDEXABLE_OPTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Indexable option enabled for a schema field.
+     * 
+ * + * INDEXABLE_ENABLED = 1; + */ + public static final int INDEXABLE_ENABLED_VALUE = 1; + /** + * + * + *
+     * Indexable option disabled for a schema field.
+     * 
+ * + * 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.discoveryengine.v1alpha.FieldConfig.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.discoveryengine.v1alpha.FieldConfig.IndexableOption) + } + + /** + * + * + *
+   * The status of the dynamic facetable option of a schema field.
+   * 
+ * + * Protobuf enum {@code google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption} + */ + public enum DynamicFacetableOption implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Value used when unset.
+     * 
+ * + * DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0; + */ + DYNAMIC_FACETABLE_OPTION_UNSPECIFIED(0), + /** + * + * + *
+     * Dynamic facetable option enabled for a schema field.
+     * 
+ * + * DYNAMIC_FACETABLE_ENABLED = 1; + */ + DYNAMIC_FACETABLE_ENABLED(1), + /** + * + * + *
+     * Dynamic facetable option disabled for a schema field.
+     * 
+ * + * DYNAMIC_FACETABLE_DISABLED = 2; + */ + DYNAMIC_FACETABLE_DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Value used when unset.
+     * 
+ * + * DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0; + */ + public static final int DYNAMIC_FACETABLE_OPTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Dynamic facetable option enabled for a schema field.
+     * 
+ * + * DYNAMIC_FACETABLE_ENABLED = 1; + */ + public static final int DYNAMIC_FACETABLE_ENABLED_VALUE = 1; + /** + * + * + *
+     * Dynamic facetable option disabled for a schema field.
+     * 
+ * + * 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.discoveryengine.v1alpha.FieldConfig.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.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption) + } + + /** + * + * + *
+   * The setting of Searchable options in schema.
+   * 
+ * + * Protobuf enum {@code google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption} + */ + public enum SearchableOption implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Value used when unset.
+     * 
+ * + * SEARCHABLE_OPTION_UNSPECIFIED = 0; + */ + SEARCHABLE_OPTION_UNSPECIFIED(0), + /** + * + * + *
+     * Searchable option enabled for a schema field.
+     * 
+ * + * SEARCHABLE_ENABLED = 1; + */ + SEARCHABLE_ENABLED(1), + /** + * + * + *
+     * Searchable option disabled for a schema field.
+     * 
+ * + * SEARCHABLE_DISABLED = 2; + */ + SEARCHABLE_DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Value used when unset.
+     * 
+ * + * SEARCHABLE_OPTION_UNSPECIFIED = 0; + */ + public static final int SEARCHABLE_OPTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Searchable option enabled for a schema field.
+     * 
+ * + * SEARCHABLE_ENABLED = 1; + */ + public static final int SEARCHABLE_ENABLED_VALUE = 1; + /** + * + * + *
+     * Searchable option disabled for a schema field.
+     * 
+ * + * 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.discoveryengine.v1alpha.FieldConfig.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.discoveryengine.v1alpha.FieldConfig.SearchableOption) + } + + /** + * + * + *
+   * The setting of Retrievable options in schema.
+   * 
+ * + * Protobuf enum {@code google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption} + */ + public enum RetrievableOption implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Value used when unset.
+     * 
+ * + * RETRIEVABLE_OPTION_UNSPECIFIED = 0; + */ + RETRIEVABLE_OPTION_UNSPECIFIED(0), + /** + * + * + *
+     * Retrievable option enabled for a schema field.
+     * 
+ * + * RETRIEVABLE_ENABLED = 1; + */ + RETRIEVABLE_ENABLED(1), + /** + * + * + *
+     * Retrievable option disabled for a schema field.
+     * 
+ * + * RETRIEVABLE_DISABLED = 2; + */ + RETRIEVABLE_DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Value used when unset.
+     * 
+ * + * RETRIEVABLE_OPTION_UNSPECIFIED = 0; + */ + public static final int RETRIEVABLE_OPTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Retrievable option enabled for a schema field.
+     * 
+ * + * RETRIEVABLE_ENABLED = 1; + */ + public static final int RETRIEVABLE_ENABLED_VALUE = 1; + /** + * + * + *
+     * Retrievable option disabled for a schema field.
+     * 
+ * + * RETRIEVABLE_DISABLED = 2; + */ + public static final int RETRIEVABLE_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 RetrievableOption 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 RetrievableOption forNumber(int value) { + switch (value) { + case 0: + return RETRIEVABLE_OPTION_UNSPECIFIED; + case 1: + return RETRIEVABLE_ENABLED; + case 2: + return RETRIEVABLE_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 RetrievableOption findValueByNumber(int number) { + return RetrievableOption.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.discoveryengine.v1alpha.FieldConfig.getDescriptor() + .getEnumTypes() + .get(4); + } + + private static final RetrievableOption[] VALUES = values(); + + public static RetrievableOption 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 RetrievableOption(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption) + } + + /** + * + * + *
+   * The setting of Completable options in schema.
+   * 
+ * + * Protobuf enum {@code google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption} + */ + public enum CompletableOption implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Value used when unset.
+     * 
+ * + * COMPLETABLE_OPTION_UNSPECIFIED = 0; + */ + COMPLETABLE_OPTION_UNSPECIFIED(0), + /** + * + * + *
+     * Completable option enabled for a schema field.
+     * 
+ * + * COMPLETABLE_ENABLED = 1; + */ + COMPLETABLE_ENABLED(1), + /** + * + * + *
+     * Completable option disabled for a schema field.
+     * 
+ * + * COMPLETABLE_DISABLED = 2; + */ + COMPLETABLE_DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Value used when unset.
+     * 
+ * + * COMPLETABLE_OPTION_UNSPECIFIED = 0; + */ + public static final int COMPLETABLE_OPTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Completable option enabled for a schema field.
+     * 
+ * + * COMPLETABLE_ENABLED = 1; + */ + public static final int COMPLETABLE_ENABLED_VALUE = 1; + /** + * + * + *
+     * Completable option disabled for a schema field.
+     * 
+ * + * COMPLETABLE_DISABLED = 2; + */ + public static final int COMPLETABLE_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 CompletableOption 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 CompletableOption forNumber(int value) { + switch (value) { + case 0: + return COMPLETABLE_OPTION_UNSPECIFIED; + case 1: + return COMPLETABLE_ENABLED; + case 2: + return COMPLETABLE_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 CompletableOption findValueByNumber(int number) { + return CompletableOption.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.discoveryengine.v1alpha.FieldConfig.getDescriptor() + .getEnumTypes() + .get(5); + } + + private static final CompletableOption[] VALUES = values(); + + public static CompletableOption 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 CompletableOption(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption) + } + + /** + * + * + *
+   * Sets the filterable option for schema fields.
+   * 
+ * + * Protobuf enum {@code google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption} + */ + public enum FilterableOption implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Value used when unset.
+     * 
+ * + * FILTERABLE_OPTION_UNSPECIFIED = 0; + */ + FILTERABLE_OPTION_UNSPECIFIED(0), + /** + * + * + *
+     * Filterable option enabled for a schema field.
+     * 
+ * + * FILTERABLE_ENABLED = 1; + */ + FILTERABLE_ENABLED(1), + /** + * + * + *
+     * Filterable option disabled for a schema field.
+     * 
+ * + * FILTERABLE_DISABLED = 2; + */ + FILTERABLE_DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Value used when unset.
+     * 
+ * + * FILTERABLE_OPTION_UNSPECIFIED = 0; + */ + public static final int FILTERABLE_OPTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Filterable option enabled for a schema field.
+     * 
+ * + * FILTERABLE_ENABLED = 1; + */ + public static final int FILTERABLE_ENABLED_VALUE = 1; + /** + * + * + *
+     * Filterable option disabled for a schema field.
+     * 
+ * + * FILTERABLE_DISABLED = 2; + */ + public static final int FILTERABLE_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 FilterableOption 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 FilterableOption forNumber(int value) { + switch (value) { + case 0: + return FILTERABLE_OPTION_UNSPECIFIED; + case 1: + return FILTERABLE_ENABLED; + case 2: + return FILTERABLE_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 FilterableOption findValueByNumber(int number) { + return FilterableOption.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.discoveryengine.v1alpha.FieldConfig.getDescriptor() + .getEnumTypes() + .get(6); + } + + private static final FilterableOption[] VALUES = values(); + + public static FilterableOption 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 FilterableOption(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption) + } + + public static final int FIELD_PATH_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object fieldPath_ = ""; + /** + * + * + *
+   * Required. Field path of the schema field.
+   * For example: `title`, `description`, `release_info.release_year`.
+   * 
+ * + * string field_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The fieldPath. + */ + @java.lang.Override + public java.lang.String getFieldPath() { + java.lang.Object ref = fieldPath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fieldPath_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Field path of the schema field.
+   * For example: `title`, `description`, `release_info.release_year`.
+   * 
+ * + * string field_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for fieldPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFieldPathBytes() { + java.lang.Object ref = fieldPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FIELD_TYPE_FIELD_NUMBER = 2; + private int fieldType_ = 0; + /** + * + * + *
+   * Output only. Raw type of the field.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType field_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for fieldType. + */ + @java.lang.Override + public int getFieldTypeValue() { + return fieldType_; + } + /** + * + * + *
+   * Output only. Raw type of the field.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType field_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The fieldType. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType getFieldType() { + com.google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType result = + com.google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType.forNumber(fieldType_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType.UNRECOGNIZED + : result; + } + + public static final int INDEXABLE_OPTION_FIELD_NUMBER = 3; + private int indexableOption_ = 0; + /** + * + * + *
+   * If
+   * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+   * is
+   * [INDEXABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_ENABLED],
+   * field values are indexed so that it can be filtered or faceted in
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+   *
+   * If
+   * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+   * is unset, the server behavior defaults to
+   * [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED]
+   * for fields that support setting indexable options. For those fields that do
+   * not support setting indexable options, such as `object` and `boolean` and
+   * key properties, the server will skip
+   * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+   * setting, and setting
+   * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+   * for those fields will throw `INVALID_ARGUMENT` error.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption indexable_option = 3; + * + * + * @return The enum numeric value on the wire for indexableOption. + */ + @java.lang.Override + public int getIndexableOptionValue() { + return indexableOption_; + } + /** + * + * + *
+   * If
+   * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+   * is
+   * [INDEXABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_ENABLED],
+   * field values are indexed so that it can be filtered or faceted in
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+   *
+   * If
+   * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+   * is unset, the server behavior defaults to
+   * [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED]
+   * for fields that support setting indexable options. For those fields that do
+   * not support setting indexable options, such as `object` and `boolean` and
+   * key properties, the server will skip
+   * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+   * setting, and setting
+   * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+   * for those fields will throw `INVALID_ARGUMENT` error.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption indexable_option = 3; + * + * + * @return The indexableOption. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption getIndexableOption() { + com.google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption result = + com.google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.forNumber( + indexableOption_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.UNRECOGNIZED + : result; + } + + public static final int DYNAMIC_FACETABLE_OPTION_FIELD_NUMBER = 4; + private int dynamicFacetableOption_ = 0; + /** + * + * + *
+   * If
+   * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+   * is
+   * [DYNAMIC_FACETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED],
+   * field values are available for dynamic facet. Could only be
+   * [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED]
+   * if
+   * [FieldConfig.indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+   * is
+   * [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED].
+   * Otherwise, an `INVALID_ARGUMENT` error will be returned.
+   *
+   * If
+   * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+   * is unset, the server behavior defaults to
+   * [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED]
+   * for fields that support setting dynamic facetable options. For those fields
+   * that do not support setting dynamic facetable options, such as `object` and
+   * `boolean`, the server will skip dynamic facetable option setting, and
+   * setting
+   * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+   * for those fields will throw `INVALID_ARGUMENT` error.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption dynamic_facetable_option = 4; + * + * + * @return The enum numeric value on the wire for dynamicFacetableOption. + */ + @java.lang.Override + public int getDynamicFacetableOptionValue() { + return dynamicFacetableOption_; + } + /** + * + * + *
+   * If
+   * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+   * is
+   * [DYNAMIC_FACETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED],
+   * field values are available for dynamic facet. Could only be
+   * [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED]
+   * if
+   * [FieldConfig.indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+   * is
+   * [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED].
+   * Otherwise, an `INVALID_ARGUMENT` error will be returned.
+   *
+   * If
+   * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+   * is unset, the server behavior defaults to
+   * [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED]
+   * for fields that support setting dynamic facetable options. For those fields
+   * that do not support setting dynamic facetable options, such as `object` and
+   * `boolean`, the server will skip dynamic facetable option setting, and
+   * setting
+   * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+   * for those fields will throw `INVALID_ARGUMENT` error.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption dynamic_facetable_option = 4; + * + * + * @return The dynamicFacetableOption. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption + getDynamicFacetableOption() { + com.google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption result = + com.google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.forNumber( + dynamicFacetableOption_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.UNRECOGNIZED + : result; + } + + public static final int SEARCHABLE_OPTION_FIELD_NUMBER = 5; + private int searchableOption_ = 0; + /** + * + * + *
+   * If
+   * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+   * is
+   * [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED],
+   * field values are searchable by text queries in
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+   *
+   * If
+   * [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED]
+   * but field type is numerical, field values will not be searchable by text
+   * queries in
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search],
+   * as there are no text values associated to numerical fields.
+   *
+   * If
+   * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+   * is unset, the server behavior defaults to
+   * [SEARCHABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_DISABLED]
+   * for fields that support setting searchable options. Only `string` fields
+   * that have no key property mapping support setting
+   * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option].
+   *
+   * For those fields that do not support setting searchable options, the server
+   * will skip searchable option setting, and setting
+   * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+   * for those fields will throw `INVALID_ARGUMENT` error.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption searchable_option = 5; + * + * + * @return The enum numeric value on the wire for searchableOption. + */ + @java.lang.Override + public int getSearchableOptionValue() { + return searchableOption_; + } + /** + * + * + *
+   * If
+   * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+   * is
+   * [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED],
+   * field values are searchable by text queries in
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+   *
+   * If
+   * [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED]
+   * but field type is numerical, field values will not be searchable by text
+   * queries in
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search],
+   * as there are no text values associated to numerical fields.
+   *
+   * If
+   * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+   * is unset, the server behavior defaults to
+   * [SEARCHABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_DISABLED]
+   * for fields that support setting searchable options. Only `string` fields
+   * that have no key property mapping support setting
+   * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option].
+   *
+   * For those fields that do not support setting searchable options, the server
+   * will skip searchable option setting, and setting
+   * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+   * for those fields will throw `INVALID_ARGUMENT` error.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption searchable_option = 5; + * + * + * @return The searchableOption. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption + getSearchableOption() { + com.google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption result = + com.google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.forNumber( + searchableOption_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.UNRECOGNIZED + : result; + } + + public static final int RETRIEVABLE_OPTION_FIELD_NUMBER = 6; + private int retrievableOption_ = 0; + /** + * + * + *
+   * If
+   * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+   * is
+   * [RETRIEVABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_ENABLED],
+   * field values are included in the search results.
+   *
+   * If
+   * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+   * is unset, the server behavior defaults to
+   * [RETRIEVABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_DISABLED]
+   * for fields that support setting retrievable options. For those fields
+   * that do not support setting retrievable options, such as `object` and
+   * `boolean`, the server will skip retrievable option setting, and setting
+   * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+   * for those fields will throw `INVALID_ARGUMENT` error.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption retrievable_option = 6; + * + * + * @return The enum numeric value on the wire for retrievableOption. + */ + @java.lang.Override + public int getRetrievableOptionValue() { + return retrievableOption_; + } + /** + * + * + *
+   * If
+   * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+   * is
+   * [RETRIEVABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_ENABLED],
+   * field values are included in the search results.
+   *
+   * If
+   * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+   * is unset, the server behavior defaults to
+   * [RETRIEVABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_DISABLED]
+   * for fields that support setting retrievable options. For those fields
+   * that do not support setting retrievable options, such as `object` and
+   * `boolean`, the server will skip retrievable option setting, and setting
+   * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+   * for those fields will throw `INVALID_ARGUMENT` error.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption retrievable_option = 6; + * + * + * @return The retrievableOption. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption + getRetrievableOption() { + com.google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption result = + com.google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.forNumber( + retrievableOption_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.UNRECOGNIZED + : result; + } + + public static final int COMPLETABLE_OPTION_FIELD_NUMBER = 8; + private int completableOption_ = 0; + /** + * + * + *
+   * If
+   * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+   * is
+   * [COMPLETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_ENABLED],
+   * field values are directly used and returned as suggestions for Autocomplete
+   * in
+   * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery].
+   *
+   * If
+   * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+   * is unset, the server behavior defaults to
+   * [COMPLETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_DISABLED]
+   * for fields that support setting completable options, which are just
+   * `string` fields. For those fields that do not support setting completable
+   * options, the server will skip completable option setting, and setting
+   * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+   * for those fields will throw `INVALID_ARGUMENT` error.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption completable_option = 8; + * + * + * @return The enum numeric value on the wire for completableOption. + */ + @java.lang.Override + public int getCompletableOptionValue() { + return completableOption_; + } + /** + * + * + *
+   * If
+   * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+   * is
+   * [COMPLETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_ENABLED],
+   * field values are directly used and returned as suggestions for Autocomplete
+   * in
+   * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery].
+   *
+   * If
+   * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+   * is unset, the server behavior defaults to
+   * [COMPLETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_DISABLED]
+   * for fields that support setting completable options, which are just
+   * `string` fields. For those fields that do not support setting completable
+   * options, the server will skip completable option setting, and setting
+   * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+   * for those fields will throw `INVALID_ARGUMENT` error.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption completable_option = 8; + * + * + * @return The completableOption. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption + getCompletableOption() { + com.google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption result = + com.google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.forNumber( + completableOption_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.UNRECOGNIZED + : result; + } + + public static final int RECS_FILTERABLE_OPTION_FIELD_NUMBER = 9; + private int recsFilterableOption_ = 0; + /** + * + * + *
+   * If
+   * [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option]
+   * is
+   * [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED],
+   * field values are filterable by filter expression in
+   * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+   *
+   * If
+   * [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED]
+   * but the field type is numerical, field values are not filterable by text
+   * queries in
+   * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+   * Only textual fields are supported.
+   *
+   * If
+   * [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option]
+   * is unset, the default setting is
+   * [FILTERABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_DISABLED]
+   * for fields that support setting filterable options.
+   *
+   * When a field set to [FILTERABLE_DISABLED] is filtered, a warning is
+   * generated and an empty result is returned.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption recs_filterable_option = 9; + * + * + * @return The enum numeric value on the wire for recsFilterableOption. + */ + @java.lang.Override + public int getRecsFilterableOptionValue() { + return recsFilterableOption_; + } + /** + * + * + *
+   * If
+   * [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option]
+   * is
+   * [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED],
+   * field values are filterable by filter expression in
+   * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+   *
+   * If
+   * [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED]
+   * but the field type is numerical, field values are not filterable by text
+   * queries in
+   * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+   * Only textual fields are supported.
+   *
+   * If
+   * [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option]
+   * is unset, the default setting is
+   * [FILTERABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_DISABLED]
+   * for fields that support setting filterable options.
+   *
+   * When a field set to [FILTERABLE_DISABLED] is filtered, a warning is
+   * generated and an empty result is returned.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption recs_filterable_option = 9; + * + * + * @return The recsFilterableOption. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption + getRecsFilterableOption() { + com.google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption result = + com.google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.forNumber( + recsFilterableOption_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.UNRECOGNIZED + : result; + } + + public static final int KEY_PROPERTY_TYPE_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object keyPropertyType_ = ""; + /** + * + * + *
+   * Output only. Type of the key property that this field is mapped to. Empty
+   * string if this is not annotated as mapped to a key property.
+   *
+   * Example types are `title`, `description`. Full list is defined
+   * by `keyPropertyMapping` in the schema field annotation.
+   *
+   * If the schema field has a `KeyPropertyMapping` annotation,
+   * `indexable_option` and `searchable_option` of this field cannot be
+   * modified.
+   * 
+ * + * string key_property_type = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The keyPropertyType. + */ + @java.lang.Override + public java.lang.String getKeyPropertyType() { + java.lang.Object ref = keyPropertyType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + keyPropertyType_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Type of the key property that this field is mapped to. Empty
+   * string if this is not annotated as mapped to a key property.
+   *
+   * Example types are `title`, `description`. Full list is defined
+   * by `keyPropertyMapping` in the schema field annotation.
+   *
+   * If the schema field has a `KeyPropertyMapping` annotation,
+   * `indexable_option` and `searchable_option` of this field cannot be
+   * modified.
+   * 
+ * + * string key_property_type = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for keyPropertyType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyPropertyTypeBytes() { + java.lang.Object ref = keyPropertyType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + keyPropertyType_ = 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(fieldPath_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fieldPath_); + } + if (fieldType_ + != com.google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType.FIELD_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, fieldType_); + } + if (indexableOption_ + != com.google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption + .INDEXABLE_OPTION_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, indexableOption_); + } + if (dynamicFacetableOption_ + != com.google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption + .DYNAMIC_FACETABLE_OPTION_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, dynamicFacetableOption_); + } + if (searchableOption_ + != com.google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption + .SEARCHABLE_OPTION_UNSPECIFIED + .getNumber()) { + output.writeEnum(5, searchableOption_); + } + if (retrievableOption_ + != com.google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption + .RETRIEVABLE_OPTION_UNSPECIFIED + .getNumber()) { + output.writeEnum(6, retrievableOption_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(keyPropertyType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, keyPropertyType_); + } + if (completableOption_ + != com.google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption + .COMPLETABLE_OPTION_UNSPECIFIED + .getNumber()) { + output.writeEnum(8, completableOption_); + } + if (recsFilterableOption_ + != com.google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption + .FILTERABLE_OPTION_UNSPECIFIED + .getNumber()) { + output.writeEnum(9, recsFilterableOption_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fieldPath_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fieldPath_); + } + if (fieldType_ + != com.google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType.FIELD_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, fieldType_); + } + if (indexableOption_ + != com.google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption + .INDEXABLE_OPTION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, indexableOption_); + } + if (dynamicFacetableOption_ + != com.google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption + .DYNAMIC_FACETABLE_OPTION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, dynamicFacetableOption_); + } + if (searchableOption_ + != com.google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption + .SEARCHABLE_OPTION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, searchableOption_); + } + if (retrievableOption_ + != com.google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption + .RETRIEVABLE_OPTION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, retrievableOption_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(keyPropertyType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, keyPropertyType_); + } + if (completableOption_ + != com.google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption + .COMPLETABLE_OPTION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, completableOption_); + } + if (recsFilterableOption_ + != com.google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption + .FILTERABLE_OPTION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, recsFilterableOption_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.FieldConfig)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.FieldConfig other = + (com.google.cloud.discoveryengine.v1alpha.FieldConfig) obj; + + if (!getFieldPath().equals(other.getFieldPath())) return false; + if (fieldType_ != other.fieldType_) return false; + if (indexableOption_ != other.indexableOption_) return false; + if (dynamicFacetableOption_ != other.dynamicFacetableOption_) return false; + if (searchableOption_ != other.searchableOption_) return false; + if (retrievableOption_ != other.retrievableOption_) return false; + if (completableOption_ != other.completableOption_) return false; + if (recsFilterableOption_ != other.recsFilterableOption_) return false; + if (!getKeyPropertyType().equals(other.getKeyPropertyType())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FIELD_PATH_FIELD_NUMBER; + hash = (53 * hash) + getFieldPath().hashCode(); + hash = (37 * hash) + FIELD_TYPE_FIELD_NUMBER; + hash = (53 * hash) + fieldType_; + 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 = (37 * hash) + RETRIEVABLE_OPTION_FIELD_NUMBER; + hash = (53 * hash) + retrievableOption_; + hash = (37 * hash) + COMPLETABLE_OPTION_FIELD_NUMBER; + hash = (53 * hash) + completableOption_; + hash = (37 * hash) + RECS_FILTERABLE_OPTION_FIELD_NUMBER; + hash = (53 * hash) + recsFilterableOption_; + hash = (37 * hash) + KEY_PROPERTY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getKeyPropertyType().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.FieldConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.FieldConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.FieldConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.FieldConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.FieldConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.FieldConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.FieldConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.FieldConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.FieldConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.FieldConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.FieldConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.FieldConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.discoveryengine.v1alpha.FieldConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Configurations for fields of a schema. For example, configuring a field is
+   * indexable, or searchable.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.FieldConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.FieldConfig) + com.google.cloud.discoveryengine.v1alpha.FieldConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaProto + .internal_static_google_cloud_discoveryengine_v1alpha_FieldConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SchemaProto + .internal_static_google_cloud_discoveryengine_v1alpha_FieldConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.FieldConfig.class, + com.google.cloud.discoveryengine.v1alpha.FieldConfig.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.FieldConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + fieldPath_ = ""; + fieldType_ = 0; + indexableOption_ = 0; + dynamicFacetableOption_ = 0; + searchableOption_ = 0; + retrievableOption_ = 0; + completableOption_ = 0; + recsFilterableOption_ = 0; + keyPropertyType_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SchemaProto + .internal_static_google_cloud_discoveryengine_v1alpha_FieldConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.FieldConfig getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.FieldConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.FieldConfig build() { + com.google.cloud.discoveryengine.v1alpha.FieldConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.FieldConfig buildPartial() { + com.google.cloud.discoveryengine.v1alpha.FieldConfig result = + new com.google.cloud.discoveryengine.v1alpha.FieldConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.FieldConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.fieldPath_ = fieldPath_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.fieldType_ = fieldType_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.indexableOption_ = indexableOption_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.dynamicFacetableOption_ = dynamicFacetableOption_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.searchableOption_ = searchableOption_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.retrievableOption_ = retrievableOption_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.completableOption_ = completableOption_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.recsFilterableOption_ = recsFilterableOption_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.keyPropertyType_ = keyPropertyType_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.FieldConfig) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.FieldConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.FieldConfig other) { + if (other == com.google.cloud.discoveryengine.v1alpha.FieldConfig.getDefaultInstance()) + return this; + if (!other.getFieldPath().isEmpty()) { + fieldPath_ = other.fieldPath_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.fieldType_ != 0) { + setFieldTypeValue(other.getFieldTypeValue()); + } + if (other.indexableOption_ != 0) { + setIndexableOptionValue(other.getIndexableOptionValue()); + } + if (other.dynamicFacetableOption_ != 0) { + setDynamicFacetableOptionValue(other.getDynamicFacetableOptionValue()); + } + if (other.searchableOption_ != 0) { + setSearchableOptionValue(other.getSearchableOptionValue()); + } + if (other.retrievableOption_ != 0) { + setRetrievableOptionValue(other.getRetrievableOptionValue()); + } + if (other.completableOption_ != 0) { + setCompletableOptionValue(other.getCompletableOptionValue()); + } + if (other.recsFilterableOption_ != 0) { + setRecsFilterableOptionValue(other.getRecsFilterableOptionValue()); + } + if (!other.getKeyPropertyType().isEmpty()) { + keyPropertyType_ = other.keyPropertyType_; + bitField0_ |= 0x00000100; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + fieldPath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + fieldType_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + indexableOption_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + dynamicFacetableOption_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + searchableOption_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: + { + retrievableOption_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + keyPropertyType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 58 + case 64: + { + completableOption_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 64 + case 72: + { + recsFilterableOption_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 72 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object fieldPath_ = ""; + /** + * + * + *
+     * Required. Field path of the schema field.
+     * For example: `title`, `description`, `release_info.release_year`.
+     * 
+ * + * string field_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The fieldPath. + */ + public java.lang.String getFieldPath() { + java.lang.Object ref = fieldPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fieldPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Field path of the schema field.
+     * For example: `title`, `description`, `release_info.release_year`.
+     * 
+ * + * string field_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for fieldPath. + */ + public com.google.protobuf.ByteString getFieldPathBytes() { + java.lang.Object ref = fieldPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Field path of the schema field.
+     * For example: `title`, `description`, `release_info.release_year`.
+     * 
+ * + * string field_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The fieldPath to set. + * @return This builder for chaining. + */ + public Builder setFieldPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fieldPath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Field path of the schema field.
+     * For example: `title`, `description`, `release_info.release_year`.
+     * 
+ * + * string field_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearFieldPath() { + fieldPath_ = getDefaultInstance().getFieldPath(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Field path of the schema field.
+     * For example: `title`, `description`, `release_info.release_year`.
+     * 
+ * + * string field_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for fieldPath to set. + * @return This builder for chaining. + */ + public Builder setFieldPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fieldPath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int fieldType_ = 0; + /** + * + * + *
+     * Output only. Raw type of the field.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType field_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for fieldType. + */ + @java.lang.Override + public int getFieldTypeValue() { + return fieldType_; + } + /** + * + * + *
+     * Output only. Raw type of the field.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType field_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for fieldType to set. + * @return This builder for chaining. + */ + public Builder setFieldTypeValue(int value) { + fieldType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Raw type of the field.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType field_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The fieldType. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType getFieldType() { + com.google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType result = + com.google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType.forNumber(fieldType_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Raw type of the field.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType field_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The fieldType to set. + * @return This builder for chaining. + */ + public Builder setFieldType( + com.google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + fieldType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Raw type of the field.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType field_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearFieldType() { + bitField0_ = (bitField0_ & ~0x00000002); + fieldType_ = 0; + onChanged(); + return this; + } + + private int indexableOption_ = 0; + /** + * + * + *
+     * If
+     * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * is
+     * [INDEXABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_ENABLED],
+     * field values are indexed so that it can be filtered or faceted in
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+     *
+     * If
+     * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * is unset, the server behavior defaults to
+     * [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED]
+     * for fields that support setting indexable options. For those fields that do
+     * not support setting indexable options, such as `object` and `boolean` and
+     * key properties, the server will skip
+     * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * setting, and setting
+     * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption indexable_option = 3; + * + * + * @return The enum numeric value on the wire for indexableOption. + */ + @java.lang.Override + public int getIndexableOptionValue() { + return indexableOption_; + } + /** + * + * + *
+     * If
+     * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * is
+     * [INDEXABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_ENABLED],
+     * field values are indexed so that it can be filtered or faceted in
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+     *
+     * If
+     * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * is unset, the server behavior defaults to
+     * [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED]
+     * for fields that support setting indexable options. For those fields that do
+     * not support setting indexable options, such as `object` and `boolean` and
+     * key properties, the server will skip
+     * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * setting, and setting
+     * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption indexable_option = 3; + * + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * If
+     * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * is
+     * [INDEXABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_ENABLED],
+     * field values are indexed so that it can be filtered or faceted in
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+     *
+     * If
+     * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * is unset, the server behavior defaults to
+     * [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED]
+     * for fields that support setting indexable options. For those fields that do
+     * not support setting indexable options, such as `object` and `boolean` and
+     * key properties, the server will skip
+     * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * setting, and setting
+     * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption indexable_option = 3; + * + * + * @return The indexableOption. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption + getIndexableOption() { + com.google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption result = + com.google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.forNumber( + indexableOption_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * If
+     * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * is
+     * [INDEXABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_ENABLED],
+     * field values are indexed so that it can be filtered or faceted in
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+     *
+     * If
+     * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * is unset, the server behavior defaults to
+     * [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED]
+     * for fields that support setting indexable options. For those fields that do
+     * not support setting indexable options, such as `object` and `boolean` and
+     * key properties, the server will skip
+     * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * setting, and setting
+     * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption indexable_option = 3; + * + * + * @param value The indexableOption to set. + * @return This builder for chaining. + */ + public Builder setIndexableOption( + com.google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + indexableOption_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * If
+     * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * is
+     * [INDEXABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_ENABLED],
+     * field values are indexed so that it can be filtered or faceted in
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+     *
+     * If
+     * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * is unset, the server behavior defaults to
+     * [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED]
+     * for fields that support setting indexable options. For those fields that do
+     * not support setting indexable options, such as `object` and `boolean` and
+     * key properties, the server will skip
+     * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * setting, and setting
+     * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption indexable_option = 3; + * + * + * @return This builder for chaining. + */ + public Builder clearIndexableOption() { + bitField0_ = (bitField0_ & ~0x00000004); + indexableOption_ = 0; + onChanged(); + return this; + } + + private int dynamicFacetableOption_ = 0; + /** + * + * + *
+     * If
+     * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+     * is
+     * [DYNAMIC_FACETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED],
+     * field values are available for dynamic facet. Could only be
+     * [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED]
+     * if
+     * [FieldConfig.indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * is
+     * [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED].
+     * Otherwise, an `INVALID_ARGUMENT` error will be returned.
+     *
+     * If
+     * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+     * is unset, the server behavior defaults to
+     * [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED]
+     * for fields that support setting dynamic facetable options. For those fields
+     * that do not support setting dynamic facetable options, such as `object` and
+     * `boolean`, the server will skip dynamic facetable option setting, and
+     * setting
+     * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption dynamic_facetable_option = 4; + * + * + * @return The enum numeric value on the wire for dynamicFacetableOption. + */ + @java.lang.Override + public int getDynamicFacetableOptionValue() { + return dynamicFacetableOption_; + } + /** + * + * + *
+     * If
+     * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+     * is
+     * [DYNAMIC_FACETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED],
+     * field values are available for dynamic facet. Could only be
+     * [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED]
+     * if
+     * [FieldConfig.indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * is
+     * [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED].
+     * Otherwise, an `INVALID_ARGUMENT` error will be returned.
+     *
+     * If
+     * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+     * is unset, the server behavior defaults to
+     * [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED]
+     * for fields that support setting dynamic facetable options. For those fields
+     * that do not support setting dynamic facetable options, such as `object` and
+     * `boolean`, the server will skip dynamic facetable option setting, and
+     * setting
+     * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption dynamic_facetable_option = 4; + * + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * If
+     * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+     * is
+     * [DYNAMIC_FACETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED],
+     * field values are available for dynamic facet. Could only be
+     * [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED]
+     * if
+     * [FieldConfig.indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * is
+     * [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED].
+     * Otherwise, an `INVALID_ARGUMENT` error will be returned.
+     *
+     * If
+     * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+     * is unset, the server behavior defaults to
+     * [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED]
+     * for fields that support setting dynamic facetable options. For those fields
+     * that do not support setting dynamic facetable options, such as `object` and
+     * `boolean`, the server will skip dynamic facetable option setting, and
+     * setting
+     * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption dynamic_facetable_option = 4; + * + * + * @return The dynamicFacetableOption. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption + getDynamicFacetableOption() { + com.google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption result = + com.google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.forNumber( + dynamicFacetableOption_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * If
+     * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+     * is
+     * [DYNAMIC_FACETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED],
+     * field values are available for dynamic facet. Could only be
+     * [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED]
+     * if
+     * [FieldConfig.indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * is
+     * [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED].
+     * Otherwise, an `INVALID_ARGUMENT` error will be returned.
+     *
+     * If
+     * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+     * is unset, the server behavior defaults to
+     * [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED]
+     * for fields that support setting dynamic facetable options. For those fields
+     * that do not support setting dynamic facetable options, such as `object` and
+     * `boolean`, the server will skip dynamic facetable option setting, and
+     * setting
+     * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption dynamic_facetable_option = 4; + * + * + * @param value The dynamicFacetableOption to set. + * @return This builder for chaining. + */ + public Builder setDynamicFacetableOption( + com.google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + dynamicFacetableOption_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * If
+     * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+     * is
+     * [DYNAMIC_FACETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED],
+     * field values are available for dynamic facet. Could only be
+     * [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED]
+     * if
+     * [FieldConfig.indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+     * is
+     * [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED].
+     * Otherwise, an `INVALID_ARGUMENT` error will be returned.
+     *
+     * If
+     * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+     * is unset, the server behavior defaults to
+     * [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED]
+     * for fields that support setting dynamic facetable options. For those fields
+     * that do not support setting dynamic facetable options, such as `object` and
+     * `boolean`, the server will skip dynamic facetable option setting, and
+     * setting
+     * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption dynamic_facetable_option = 4; + * + * + * @return This builder for chaining. + */ + public Builder clearDynamicFacetableOption() { + bitField0_ = (bitField0_ & ~0x00000008); + dynamicFacetableOption_ = 0; + onChanged(); + return this; + } + + private int searchableOption_ = 0; + /** + * + * + *
+     * If
+     * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+     * is
+     * [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED],
+     * field values are searchable by text queries in
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+     *
+     * If
+     * [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED]
+     * but field type is numerical, field values will not be searchable by text
+     * queries in
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search],
+     * as there are no text values associated to numerical fields.
+     *
+     * If
+     * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+     * is unset, the server behavior defaults to
+     * [SEARCHABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_DISABLED]
+     * for fields that support setting searchable options. Only `string` fields
+     * that have no key property mapping support setting
+     * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option].
+     *
+     * For those fields that do not support setting searchable options, the server
+     * will skip searchable option setting, and setting
+     * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption searchable_option = 5; + * + * + * @return The enum numeric value on the wire for searchableOption. + */ + @java.lang.Override + public int getSearchableOptionValue() { + return searchableOption_; + } + /** + * + * + *
+     * If
+     * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+     * is
+     * [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED],
+     * field values are searchable by text queries in
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+     *
+     * If
+     * [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED]
+     * but field type is numerical, field values will not be searchable by text
+     * queries in
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search],
+     * as there are no text values associated to numerical fields.
+     *
+     * If
+     * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+     * is unset, the server behavior defaults to
+     * [SEARCHABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_DISABLED]
+     * for fields that support setting searchable options. Only `string` fields
+     * that have no key property mapping support setting
+     * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option].
+     *
+     * For those fields that do not support setting searchable options, the server
+     * will skip searchable option setting, and setting
+     * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption searchable_option = 5; + * + * + * @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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * If
+     * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+     * is
+     * [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED],
+     * field values are searchable by text queries in
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+     *
+     * If
+     * [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED]
+     * but field type is numerical, field values will not be searchable by text
+     * queries in
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search],
+     * as there are no text values associated to numerical fields.
+     *
+     * If
+     * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+     * is unset, the server behavior defaults to
+     * [SEARCHABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_DISABLED]
+     * for fields that support setting searchable options. Only `string` fields
+     * that have no key property mapping support setting
+     * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option].
+     *
+     * For those fields that do not support setting searchable options, the server
+     * will skip searchable option setting, and setting
+     * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption searchable_option = 5; + * + * + * @return The searchableOption. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption + getSearchableOption() { + com.google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption result = + com.google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.forNumber( + searchableOption_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * If
+     * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+     * is
+     * [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED],
+     * field values are searchable by text queries in
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+     *
+     * If
+     * [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED]
+     * but field type is numerical, field values will not be searchable by text
+     * queries in
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search],
+     * as there are no text values associated to numerical fields.
+     *
+     * If
+     * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+     * is unset, the server behavior defaults to
+     * [SEARCHABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_DISABLED]
+     * for fields that support setting searchable options. Only `string` fields
+     * that have no key property mapping support setting
+     * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option].
+     *
+     * For those fields that do not support setting searchable options, the server
+     * will skip searchable option setting, and setting
+     * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption searchable_option = 5; + * + * + * @param value The searchableOption to set. + * @return This builder for chaining. + */ + public Builder setSearchableOption( + com.google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + searchableOption_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * If
+     * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+     * is
+     * [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED],
+     * field values are searchable by text queries in
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+     *
+     * If
+     * [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED]
+     * but field type is numerical, field values will not be searchable by text
+     * queries in
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search],
+     * as there are no text values associated to numerical fields.
+     *
+     * If
+     * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+     * is unset, the server behavior defaults to
+     * [SEARCHABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_DISABLED]
+     * for fields that support setting searchable options. Only `string` fields
+     * that have no key property mapping support setting
+     * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option].
+     *
+     * For those fields that do not support setting searchable options, the server
+     * will skip searchable option setting, and setting
+     * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption searchable_option = 5; + * + * + * @return This builder for chaining. + */ + public Builder clearSearchableOption() { + bitField0_ = (bitField0_ & ~0x00000010); + searchableOption_ = 0; + onChanged(); + return this; + } + + private int retrievableOption_ = 0; + /** + * + * + *
+     * If
+     * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+     * is
+     * [RETRIEVABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_ENABLED],
+     * field values are included in the search results.
+     *
+     * If
+     * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+     * is unset, the server behavior defaults to
+     * [RETRIEVABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_DISABLED]
+     * for fields that support setting retrievable options. For those fields
+     * that do not support setting retrievable options, such as `object` and
+     * `boolean`, the server will skip retrievable option setting, and setting
+     * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption retrievable_option = 6; + * + * + * @return The enum numeric value on the wire for retrievableOption. + */ + @java.lang.Override + public int getRetrievableOptionValue() { + return retrievableOption_; + } + /** + * + * + *
+     * If
+     * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+     * is
+     * [RETRIEVABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_ENABLED],
+     * field values are included in the search results.
+     *
+     * If
+     * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+     * is unset, the server behavior defaults to
+     * [RETRIEVABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_DISABLED]
+     * for fields that support setting retrievable options. For those fields
+     * that do not support setting retrievable options, such as `object` and
+     * `boolean`, the server will skip retrievable option setting, and setting
+     * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption retrievable_option = 6; + * + * + * @param value The enum numeric value on the wire for retrievableOption to set. + * @return This builder for chaining. + */ + public Builder setRetrievableOptionValue(int value) { + retrievableOption_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * If
+     * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+     * is
+     * [RETRIEVABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_ENABLED],
+     * field values are included in the search results.
+     *
+     * If
+     * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+     * is unset, the server behavior defaults to
+     * [RETRIEVABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_DISABLED]
+     * for fields that support setting retrievable options. For those fields
+     * that do not support setting retrievable options, such as `object` and
+     * `boolean`, the server will skip retrievable option setting, and setting
+     * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption retrievable_option = 6; + * + * + * @return The retrievableOption. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption + getRetrievableOption() { + com.google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption result = + com.google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.forNumber( + retrievableOption_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * If
+     * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+     * is
+     * [RETRIEVABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_ENABLED],
+     * field values are included in the search results.
+     *
+     * If
+     * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+     * is unset, the server behavior defaults to
+     * [RETRIEVABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_DISABLED]
+     * for fields that support setting retrievable options. For those fields
+     * that do not support setting retrievable options, such as `object` and
+     * `boolean`, the server will skip retrievable option setting, and setting
+     * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption retrievable_option = 6; + * + * + * @param value The retrievableOption to set. + * @return This builder for chaining. + */ + public Builder setRetrievableOption( + com.google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + retrievableOption_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * If
+     * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+     * is
+     * [RETRIEVABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_ENABLED],
+     * field values are included in the search results.
+     *
+     * If
+     * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+     * is unset, the server behavior defaults to
+     * [RETRIEVABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_DISABLED]
+     * for fields that support setting retrievable options. For those fields
+     * that do not support setting retrievable options, such as `object` and
+     * `boolean`, the server will skip retrievable option setting, and setting
+     * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption retrievable_option = 6; + * + * + * @return This builder for chaining. + */ + public Builder clearRetrievableOption() { + bitField0_ = (bitField0_ & ~0x00000020); + retrievableOption_ = 0; + onChanged(); + return this; + } + + private int completableOption_ = 0; + /** + * + * + *
+     * If
+     * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+     * is
+     * [COMPLETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_ENABLED],
+     * field values are directly used and returned as suggestions for Autocomplete
+     * in
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery].
+     *
+     * If
+     * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+     * is unset, the server behavior defaults to
+     * [COMPLETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_DISABLED]
+     * for fields that support setting completable options, which are just
+     * `string` fields. For those fields that do not support setting completable
+     * options, the server will skip completable option setting, and setting
+     * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption completable_option = 8; + * + * + * @return The enum numeric value on the wire for completableOption. + */ + @java.lang.Override + public int getCompletableOptionValue() { + return completableOption_; + } + /** + * + * + *
+     * If
+     * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+     * is
+     * [COMPLETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_ENABLED],
+     * field values are directly used and returned as suggestions for Autocomplete
+     * in
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery].
+     *
+     * If
+     * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+     * is unset, the server behavior defaults to
+     * [COMPLETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_DISABLED]
+     * for fields that support setting completable options, which are just
+     * `string` fields. For those fields that do not support setting completable
+     * options, the server will skip completable option setting, and setting
+     * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption completable_option = 8; + * + * + * @param value The enum numeric value on the wire for completableOption to set. + * @return This builder for chaining. + */ + public Builder setCompletableOptionValue(int value) { + completableOption_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * If
+     * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+     * is
+     * [COMPLETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_ENABLED],
+     * field values are directly used and returned as suggestions for Autocomplete
+     * in
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery].
+     *
+     * If
+     * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+     * is unset, the server behavior defaults to
+     * [COMPLETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_DISABLED]
+     * for fields that support setting completable options, which are just
+     * `string` fields. For those fields that do not support setting completable
+     * options, the server will skip completable option setting, and setting
+     * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption completable_option = 8; + * + * + * @return The completableOption. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption + getCompletableOption() { + com.google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption result = + com.google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.forNumber( + completableOption_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * If
+     * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+     * is
+     * [COMPLETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_ENABLED],
+     * field values are directly used and returned as suggestions for Autocomplete
+     * in
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery].
+     *
+     * If
+     * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+     * is unset, the server behavior defaults to
+     * [COMPLETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_DISABLED]
+     * for fields that support setting completable options, which are just
+     * `string` fields. For those fields that do not support setting completable
+     * options, the server will skip completable option setting, and setting
+     * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption completable_option = 8; + * + * + * @param value The completableOption to set. + * @return This builder for chaining. + */ + public Builder setCompletableOption( + com.google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + completableOption_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * If
+     * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+     * is
+     * [COMPLETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_ENABLED],
+     * field values are directly used and returned as suggestions for Autocomplete
+     * in
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery].
+     *
+     * If
+     * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+     * is unset, the server behavior defaults to
+     * [COMPLETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_DISABLED]
+     * for fields that support setting completable options, which are just
+     * `string` fields. For those fields that do not support setting completable
+     * options, the server will skip completable option setting, and setting
+     * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+     * for those fields will throw `INVALID_ARGUMENT` error.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption completable_option = 8; + * + * + * @return This builder for chaining. + */ + public Builder clearCompletableOption() { + bitField0_ = (bitField0_ & ~0x00000040); + completableOption_ = 0; + onChanged(); + return this; + } + + private int recsFilterableOption_ = 0; + /** + * + * + *
+     * If
+     * [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option]
+     * is
+     * [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED],
+     * field values are filterable by filter expression in
+     * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+     *
+     * If
+     * [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED]
+     * but the field type is numerical, field values are not filterable by text
+     * queries in
+     * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+     * Only textual fields are supported.
+     *
+     * If
+     * [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option]
+     * is unset, the default setting is
+     * [FILTERABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_DISABLED]
+     * for fields that support setting filterable options.
+     *
+     * When a field set to [FILTERABLE_DISABLED] is filtered, a warning is
+     * generated and an empty result is returned.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption recs_filterable_option = 9; + * + * + * @return The enum numeric value on the wire for recsFilterableOption. + */ + @java.lang.Override + public int getRecsFilterableOptionValue() { + return recsFilterableOption_; + } + /** + * + * + *
+     * If
+     * [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option]
+     * is
+     * [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED],
+     * field values are filterable by filter expression in
+     * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+     *
+     * If
+     * [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED]
+     * but the field type is numerical, field values are not filterable by text
+     * queries in
+     * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+     * Only textual fields are supported.
+     *
+     * If
+     * [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option]
+     * is unset, the default setting is
+     * [FILTERABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_DISABLED]
+     * for fields that support setting filterable options.
+     *
+     * When a field set to [FILTERABLE_DISABLED] is filtered, a warning is
+     * generated and an empty result is returned.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption recs_filterable_option = 9; + * + * + * @param value The enum numeric value on the wire for recsFilterableOption to set. + * @return This builder for chaining. + */ + public Builder setRecsFilterableOptionValue(int value) { + recsFilterableOption_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * If
+     * [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option]
+     * is
+     * [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED],
+     * field values are filterable by filter expression in
+     * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+     *
+     * If
+     * [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED]
+     * but the field type is numerical, field values are not filterable by text
+     * queries in
+     * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+     * Only textual fields are supported.
+     *
+     * If
+     * [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option]
+     * is unset, the default setting is
+     * [FILTERABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_DISABLED]
+     * for fields that support setting filterable options.
+     *
+     * When a field set to [FILTERABLE_DISABLED] is filtered, a warning is
+     * generated and an empty result is returned.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption recs_filterable_option = 9; + * + * + * @return The recsFilterableOption. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption + getRecsFilterableOption() { + com.google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption result = + com.google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.forNumber( + recsFilterableOption_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * If
+     * [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option]
+     * is
+     * [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED],
+     * field values are filterable by filter expression in
+     * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+     *
+     * If
+     * [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED]
+     * but the field type is numerical, field values are not filterable by text
+     * queries in
+     * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+     * Only textual fields are supported.
+     *
+     * If
+     * [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option]
+     * is unset, the default setting is
+     * [FILTERABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_DISABLED]
+     * for fields that support setting filterable options.
+     *
+     * When a field set to [FILTERABLE_DISABLED] is filtered, a warning is
+     * generated and an empty result is returned.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption recs_filterable_option = 9; + * + * + * @param value The recsFilterableOption to set. + * @return This builder for chaining. + */ + public Builder setRecsFilterableOption( + com.google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + recsFilterableOption_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * If
+     * [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option]
+     * is
+     * [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED],
+     * field values are filterable by filter expression in
+     * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+     *
+     * If
+     * [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED]
+     * but the field type is numerical, field values are not filterable by text
+     * queries in
+     * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+     * Only textual fields are supported.
+     *
+     * If
+     * [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option]
+     * is unset, the default setting is
+     * [FILTERABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_DISABLED]
+     * for fields that support setting filterable options.
+     *
+     * When a field set to [FILTERABLE_DISABLED] is filtered, a warning is
+     * generated and an empty result is returned.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption recs_filterable_option = 9; + * + * + * @return This builder for chaining. + */ + public Builder clearRecsFilterableOption() { + bitField0_ = (bitField0_ & ~0x00000080); + recsFilterableOption_ = 0; + onChanged(); + return this; + } + + private java.lang.Object keyPropertyType_ = ""; + /** + * + * + *
+     * Output only. Type of the key property that this field is mapped to. Empty
+     * string if this is not annotated as mapped to a key property.
+     *
+     * Example types are `title`, `description`. Full list is defined
+     * by `keyPropertyMapping` in the schema field annotation.
+     *
+     * If the schema field has a `KeyPropertyMapping` annotation,
+     * `indexable_option` and `searchable_option` of this field cannot be
+     * modified.
+     * 
+ * + * string key_property_type = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The keyPropertyType. + */ + public java.lang.String getKeyPropertyType() { + java.lang.Object ref = keyPropertyType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + keyPropertyType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Type of the key property that this field is mapped to. Empty
+     * string if this is not annotated as mapped to a key property.
+     *
+     * Example types are `title`, `description`. Full list is defined
+     * by `keyPropertyMapping` in the schema field annotation.
+     *
+     * If the schema field has a `KeyPropertyMapping` annotation,
+     * `indexable_option` and `searchable_option` of this field cannot be
+     * modified.
+     * 
+ * + * string key_property_type = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for keyPropertyType. + */ + public com.google.protobuf.ByteString getKeyPropertyTypeBytes() { + java.lang.Object ref = keyPropertyType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + keyPropertyType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Type of the key property that this field is mapped to. Empty
+     * string if this is not annotated as mapped to a key property.
+     *
+     * Example types are `title`, `description`. Full list is defined
+     * by `keyPropertyMapping` in the schema field annotation.
+     *
+     * If the schema field has a `KeyPropertyMapping` annotation,
+     * `indexable_option` and `searchable_option` of this field cannot be
+     * modified.
+     * 
+ * + * string key_property_type = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The keyPropertyType to set. + * @return This builder for chaining. + */ + public Builder setKeyPropertyType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + keyPropertyType_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of the key property that this field is mapped to. Empty
+     * string if this is not annotated as mapped to a key property.
+     *
+     * Example types are `title`, `description`. Full list is defined
+     * by `keyPropertyMapping` in the schema field annotation.
+     *
+     * If the schema field has a `KeyPropertyMapping` annotation,
+     * `indexable_option` and `searchable_option` of this field cannot be
+     * modified.
+     * 
+ * + * string key_property_type = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearKeyPropertyType() { + keyPropertyType_ = getDefaultInstance().getKeyPropertyType(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of the key property that this field is mapped to. Empty
+     * string if this is not annotated as mapped to a key property.
+     *
+     * Example types are `title`, `description`. Full list is defined
+     * by `keyPropertyMapping` in the schema field annotation.
+     *
+     * If the schema field has a `KeyPropertyMapping` annotation,
+     * `indexable_option` and `searchable_option` of this field cannot be
+     * modified.
+     * 
+ * + * string key_property_type = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for keyPropertyType to set. + * @return This builder for chaining. + */ + public Builder setKeyPropertyTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + keyPropertyType_ = value; + bitField0_ |= 0x00000100; + 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.discoveryengine.v1alpha.FieldConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.FieldConfig) + private static final com.google.cloud.discoveryengine.v1alpha.FieldConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.FieldConfig(); + } + + public static com.google.cloud.discoveryengine.v1alpha.FieldConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FieldConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.FieldConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/FieldConfigOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/FieldConfigOrBuilder.java new file mode 100644 index 000000000000..6c2a1d8c9944 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/FieldConfigOrBuilder.java @@ -0,0 +1,521 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface FieldConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.FieldConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Field path of the schema field.
+   * For example: `title`, `description`, `release_info.release_year`.
+   * 
+ * + * string field_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The fieldPath. + */ + java.lang.String getFieldPath(); + /** + * + * + *
+   * Required. Field path of the schema field.
+   * For example: `title`, `description`, `release_info.release_year`.
+   * 
+ * + * string field_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for fieldPath. + */ + com.google.protobuf.ByteString getFieldPathBytes(); + + /** + * + * + *
+   * Output only. Raw type of the field.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType field_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for fieldType. + */ + int getFieldTypeValue(); + /** + * + * + *
+   * Output only. Raw type of the field.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType field_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The fieldType. + */ + com.google.cloud.discoveryengine.v1alpha.FieldConfig.FieldType getFieldType(); + + /** + * + * + *
+   * If
+   * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+   * is
+   * [INDEXABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_ENABLED],
+   * field values are indexed so that it can be filtered or faceted in
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+   *
+   * If
+   * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+   * is unset, the server behavior defaults to
+   * [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED]
+   * for fields that support setting indexable options. For those fields that do
+   * not support setting indexable options, such as `object` and `boolean` and
+   * key properties, the server will skip
+   * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+   * setting, and setting
+   * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+   * for those fields will throw `INVALID_ARGUMENT` error.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption indexable_option = 3; + * + * + * @return The enum numeric value on the wire for indexableOption. + */ + int getIndexableOptionValue(); + /** + * + * + *
+   * If
+   * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+   * is
+   * [INDEXABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_ENABLED],
+   * field values are indexed so that it can be filtered or faceted in
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+   *
+   * If
+   * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+   * is unset, the server behavior defaults to
+   * [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED]
+   * for fields that support setting indexable options. For those fields that do
+   * not support setting indexable options, such as `object` and `boolean` and
+   * key properties, the server will skip
+   * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+   * setting, and setting
+   * [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+   * for those fields will throw `INVALID_ARGUMENT` error.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption indexable_option = 3; + * + * + * @return The indexableOption. + */ + com.google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption getIndexableOption(); + + /** + * + * + *
+   * If
+   * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+   * is
+   * [DYNAMIC_FACETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED],
+   * field values are available for dynamic facet. Could only be
+   * [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED]
+   * if
+   * [FieldConfig.indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+   * is
+   * [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED].
+   * Otherwise, an `INVALID_ARGUMENT` error will be returned.
+   *
+   * If
+   * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+   * is unset, the server behavior defaults to
+   * [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED]
+   * for fields that support setting dynamic facetable options. For those fields
+   * that do not support setting dynamic facetable options, such as `object` and
+   * `boolean`, the server will skip dynamic facetable option setting, and
+   * setting
+   * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+   * for those fields will throw `INVALID_ARGUMENT` error.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption dynamic_facetable_option = 4; + * + * + * @return The enum numeric value on the wire for dynamicFacetableOption. + */ + int getDynamicFacetableOptionValue(); + /** + * + * + *
+   * If
+   * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+   * is
+   * [DYNAMIC_FACETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED],
+   * field values are available for dynamic facet. Could only be
+   * [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED]
+   * if
+   * [FieldConfig.indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option]
+   * is
+   * [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED].
+   * Otherwise, an `INVALID_ARGUMENT` error will be returned.
+   *
+   * If
+   * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+   * is unset, the server behavior defaults to
+   * [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED]
+   * for fields that support setting dynamic facetable options. For those fields
+   * that do not support setting dynamic facetable options, such as `object` and
+   * `boolean`, the server will skip dynamic facetable option setting, and
+   * setting
+   * [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option]
+   * for those fields will throw `INVALID_ARGUMENT` error.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption dynamic_facetable_option = 4; + * + * + * @return The dynamicFacetableOption. + */ + com.google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption + getDynamicFacetableOption(); + + /** + * + * + *
+   * If
+   * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+   * is
+   * [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED],
+   * field values are searchable by text queries in
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+   *
+   * If
+   * [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED]
+   * but field type is numerical, field values will not be searchable by text
+   * queries in
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search],
+   * as there are no text values associated to numerical fields.
+   *
+   * If
+   * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+   * is unset, the server behavior defaults to
+   * [SEARCHABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_DISABLED]
+   * for fields that support setting searchable options. Only `string` fields
+   * that have no key property mapping support setting
+   * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option].
+   *
+   * For those fields that do not support setting searchable options, the server
+   * will skip searchable option setting, and setting
+   * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+   * for those fields will throw `INVALID_ARGUMENT` error.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption searchable_option = 5; + * + * + * @return The enum numeric value on the wire for searchableOption. + */ + int getSearchableOptionValue(); + /** + * + * + *
+   * If
+   * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+   * is
+   * [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED],
+   * field values are searchable by text queries in
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+   *
+   * If
+   * [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED]
+   * but field type is numerical, field values will not be searchable by text
+   * queries in
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search],
+   * as there are no text values associated to numerical fields.
+   *
+   * If
+   * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+   * is unset, the server behavior defaults to
+   * [SEARCHABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_DISABLED]
+   * for fields that support setting searchable options. Only `string` fields
+   * that have no key property mapping support setting
+   * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option].
+   *
+   * For those fields that do not support setting searchable options, the server
+   * will skip searchable option setting, and setting
+   * [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]
+   * for those fields will throw `INVALID_ARGUMENT` error.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption searchable_option = 5; + * + * + * @return The searchableOption. + */ + com.google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption getSearchableOption(); + + /** + * + * + *
+   * If
+   * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+   * is
+   * [RETRIEVABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_ENABLED],
+   * field values are included in the search results.
+   *
+   * If
+   * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+   * is unset, the server behavior defaults to
+   * [RETRIEVABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_DISABLED]
+   * for fields that support setting retrievable options. For those fields
+   * that do not support setting retrievable options, such as `object` and
+   * `boolean`, the server will skip retrievable option setting, and setting
+   * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+   * for those fields will throw `INVALID_ARGUMENT` error.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption retrievable_option = 6; + * + * + * @return The enum numeric value on the wire for retrievableOption. + */ + int getRetrievableOptionValue(); + /** + * + * + *
+   * If
+   * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+   * is
+   * [RETRIEVABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_ENABLED],
+   * field values are included in the search results.
+   *
+   * If
+   * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+   * is unset, the server behavior defaults to
+   * [RETRIEVABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_DISABLED]
+   * for fields that support setting retrievable options. For those fields
+   * that do not support setting retrievable options, such as `object` and
+   * `boolean`, the server will skip retrievable option setting, and setting
+   * [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option]
+   * for those fields will throw `INVALID_ARGUMENT` error.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption retrievable_option = 6; + * + * + * @return The retrievableOption. + */ + com.google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption getRetrievableOption(); + + /** + * + * + *
+   * If
+   * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+   * is
+   * [COMPLETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_ENABLED],
+   * field values are directly used and returned as suggestions for Autocomplete
+   * in
+   * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery].
+   *
+   * If
+   * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+   * is unset, the server behavior defaults to
+   * [COMPLETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_DISABLED]
+   * for fields that support setting completable options, which are just
+   * `string` fields. For those fields that do not support setting completable
+   * options, the server will skip completable option setting, and setting
+   * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+   * for those fields will throw `INVALID_ARGUMENT` error.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption completable_option = 8; + * + * + * @return The enum numeric value on the wire for completableOption. + */ + int getCompletableOptionValue(); + /** + * + * + *
+   * If
+   * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+   * is
+   * [COMPLETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_ENABLED],
+   * field values are directly used and returned as suggestions for Autocomplete
+   * in
+   * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery].
+   *
+   * If
+   * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+   * is unset, the server behavior defaults to
+   * [COMPLETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_DISABLED]
+   * for fields that support setting completable options, which are just
+   * `string` fields. For those fields that do not support setting completable
+   * options, the server will skip completable option setting, and setting
+   * [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option]
+   * for those fields will throw `INVALID_ARGUMENT` error.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption completable_option = 8; + * + * + * @return The completableOption. + */ + com.google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption getCompletableOption(); + + /** + * + * + *
+   * If
+   * [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option]
+   * is
+   * [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED],
+   * field values are filterable by filter expression in
+   * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+   *
+   * If
+   * [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED]
+   * but the field type is numerical, field values are not filterable by text
+   * queries in
+   * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+   * Only textual fields are supported.
+   *
+   * If
+   * [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option]
+   * is unset, the default setting is
+   * [FILTERABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_DISABLED]
+   * for fields that support setting filterable options.
+   *
+   * When a field set to [FILTERABLE_DISABLED] is filtered, a warning is
+   * generated and an empty result is returned.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption recs_filterable_option = 9; + * + * + * @return The enum numeric value on the wire for recsFilterableOption. + */ + int getRecsFilterableOptionValue(); + /** + * + * + *
+   * If
+   * [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option]
+   * is
+   * [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED],
+   * field values are filterable by filter expression in
+   * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+   *
+   * If
+   * [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED]
+   * but the field type is numerical, field values are not filterable by text
+   * queries in
+   * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+   * Only textual fields are supported.
+   *
+   * If
+   * [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option]
+   * is unset, the default setting is
+   * [FILTERABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_DISABLED]
+   * for fields that support setting filterable options.
+   *
+   * When a field set to [FILTERABLE_DISABLED] is filtered, a warning is
+   * generated and an empty result is returned.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption recs_filterable_option = 9; + * + * + * @return The recsFilterableOption. + */ + com.google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption getRecsFilterableOption(); + + /** + * + * + *
+   * Output only. Type of the key property that this field is mapped to. Empty
+   * string if this is not annotated as mapped to a key property.
+   *
+   * Example types are `title`, `description`. Full list is defined
+   * by `keyPropertyMapping` in the schema field annotation.
+   *
+   * If the schema field has a `KeyPropertyMapping` annotation,
+   * `indexable_option` and `searchable_option` of this field cannot be
+   * modified.
+   * 
+ * + * string key_property_type = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The keyPropertyType. + */ + java.lang.String getKeyPropertyType(); + /** + * + * + *
+   * Output only. Type of the key property that this field is mapped to. Empty
+   * string if this is not annotated as mapped to a key property.
+   *
+   * Example types are `title`, `description`. Full list is defined
+   * by `keyPropertyMapping` in the schema field annotation.
+   *
+   * If the schema field has a `KeyPropertyMapping` annotation,
+   * `indexable_option` and `searchable_option` of this field cannot be
+   * modified.
+   * 
+ * + * string key_property_type = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for keyPropertyType. + */ + com.google.protobuf.ByteString getKeyPropertyTypeBytes(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GcsSource.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GcsSource.java new file mode 100644 index 000000000000..89fff3197f3a --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GcsSource.java @@ -0,0 +1,1153 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/import_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Cloud Storage location for input content.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.GcsSource} + */ +public final class GcsSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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.emptyList(); + dataSchema_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GcsSource(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_GcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.GcsSource.class, + com.google.cloud.discoveryengine.v1alpha.GcsSource.Builder.class); + } + + public static final int INPUT_URIS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList inputUris_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Required. 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 (or 100,000 files if `data_schema`
+   * is `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` is
+   * `content`).
+   * 
+ * + * 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. 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 (or 100,000 files if `data_schema`
+   * is `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` is
+   * `content`).
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of inputUris. + */ + public int getInputUrisCount() { + return inputUris_.size(); + } + /** + * + * + *
+   * Required. 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 (or 100,000 files if `data_schema`
+   * is `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` is
+   * `content`).
+   * 
+ * + * 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. 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 (or 100,000 files if `data_schema`
+   * is `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` is
+   * `content`).
+   * 
+ * + * 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; + + @SuppressWarnings("serial") + private volatile java.lang.Object dataSchema_ = ""; + /** + * + * + *
+   * The schema to use when parsing the data from the source.
+   *
+   * Supported values for document imports:
+   *
+   * * `document` (default): One JSON
+   * [Document][google.cloud.discoveryengine.v1alpha.Document] per line. Each
+   * document must
+   *   have a valid
+   *   [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+   * * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by
+   *   `input_uris` becomes a document, with the ID set to the first 128
+   *   bits of SHA256(URI) encoded as a hex string.
+   * * `custom`: One custom data JSON per row in arbitrary format that conforms
+   *   to the defined [Schema][google.cloud.discoveryengine.v1alpha.Schema] of
+   *   the data store. This can only be used by Gen App Builder.
+   * * `csv`: A CSV file with header conforming to the defined
+   * [Schema][google.cloud.discoveryengine.v1alpha.Schema] of the
+   *   data store. Each entry after the header is imported as a Document.
+   *   This can only be used by Gen App Builder.
+   *
+   * Supported values for user even imports:
+   *
+   * * `user_event` (default): One JSON
+   * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] 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 document imports:
+   *
+   * * `document` (default): One JSON
+   * [Document][google.cloud.discoveryengine.v1alpha.Document] per line. Each
+   * document must
+   *   have a valid
+   *   [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+   * * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by
+   *   `input_uris` becomes a document, with the ID set to the first 128
+   *   bits of SHA256(URI) encoded as a hex string.
+   * * `custom`: One custom data JSON per row in arbitrary format that conforms
+   *   to the defined [Schema][google.cloud.discoveryengine.v1alpha.Schema] of
+   *   the data store. This can only be used by Gen App Builder.
+   * * `csv`: A CSV file with header conforming to the defined
+   * [Schema][google.cloud.discoveryengine.v1alpha.Schema] of the
+   *   data store. Each entry after the header is imported as a Document.
+   *   This can only be used by Gen App Builder.
+   *
+   * Supported values for user even imports:
+   *
+   * * `user_event` (default): One JSON
+   * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] 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_); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.GcsSource)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.GcsSource other = + (com.google.cloud.discoveryengine.v1alpha.GcsSource) obj; + + if (!getInputUrisList().equals(other.getInputUrisList())) return false; + if (!getDataSchema().equals(other.getDataSchema())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.GcsSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.GcsSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.GcsSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.GcsSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.GcsSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.GcsSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.GcsSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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; + } + /** + * + * + *
+   * Cloud Storage location for input content.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.GcsSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.GcsSource) + com.google.cloud.discoveryengine.v1alpha.GcsSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_GcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.GcsSource.class, + com.google.cloud.discoveryengine.v1alpha.GcsSource.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.GcsSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + inputUris_ = com.google.protobuf.LazyStringArrayList.emptyList(); + dataSchema_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_GcsSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GcsSource getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.GcsSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GcsSource build() { + com.google.cloud.discoveryengine.v1alpha.GcsSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GcsSource buildPartial() { + com.google.cloud.discoveryengine.v1alpha.GcsSource result = + new com.google.cloud.discoveryengine.v1alpha.GcsSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.GcsSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + inputUris_.makeImmutable(); + result.inputUris_ = inputUris_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.dataSchema_ = dataSchema_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.GcsSource) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.GcsSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.GcsSource other) { + if (other == com.google.cloud.discoveryengine.v1alpha.GcsSource.getDefaultInstance()) + return this; + if (!other.inputUris_.isEmpty()) { + if (inputUris_.isEmpty()) { + inputUris_ = other.inputUris_; + bitField0_ |= 0x00000001; + } else { + ensureInputUrisIsMutable(); + inputUris_.addAll(other.inputUris_); + } + onChanged(); + } + if (!other.getDataSchema().isEmpty()) { + dataSchema_ = other.dataSchema_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureInputUrisIsMutable(); + inputUris_.add(s); + break; + } // case 10 + case 18: + { + dataSchema_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList inputUris_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureInputUrisIsMutable() { + if (!inputUris_.isModifiable()) { + inputUris_ = new com.google.protobuf.LazyStringArrayList(inputUris_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+     * Required. 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 (or 100,000 files if `data_schema`
+     * is `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` is
+     * `content`).
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the inputUris. + */ + public com.google.protobuf.ProtocolStringList getInputUrisList() { + inputUris_.makeImmutable(); + return inputUris_; + } + /** + * + * + *
+     * Required. 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 (or 100,000 files if `data_schema`
+     * is `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` is
+     * `content`).
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of inputUris. + */ + public int getInputUrisCount() { + return inputUris_.size(); + } + /** + * + * + *
+     * Required. 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 (or 100,000 files if `data_schema`
+     * is `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` is
+     * `content`).
+     * 
+ * + * 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. 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 (or 100,000 files if `data_schema`
+     * is `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` is
+     * `content`).
+     * 
+ * + * 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. 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 (or 100,000 files if `data_schema`
+     * is `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` is
+     * `content`).
+     * 
+ * + * 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); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. 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 (or 100,000 files if `data_schema`
+     * is `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` is
+     * `content`).
+     * 
+ * + * 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); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. 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 (or 100,000 files if `data_schema`
+     * is `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` is
+     * `content`).
+     * 
+ * + * 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_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. 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 (or 100,000 files if `data_schema`
+     * is `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` is
+     * `content`).
+     * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInputUris() { + inputUris_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. 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 (or 100,000 files if `data_schema`
+     * is `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` is
+     * `content`).
+     * 
+ * + * 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); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object dataSchema_ = ""; + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     *
+     * Supported values for document imports:
+     *
+     * * `document` (default): One JSON
+     * [Document][google.cloud.discoveryengine.v1alpha.Document] per line. Each
+     * document must
+     *   have a valid
+     *   [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+     * * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by
+     *   `input_uris` becomes a document, with the ID set to the first 128
+     *   bits of SHA256(URI) encoded as a hex string.
+     * * `custom`: One custom data JSON per row in arbitrary format that conforms
+     *   to the defined [Schema][google.cloud.discoveryengine.v1alpha.Schema] of
+     *   the data store. This can only be used by Gen App Builder.
+     * * `csv`: A CSV file with header conforming to the defined
+     * [Schema][google.cloud.discoveryengine.v1alpha.Schema] of the
+     *   data store. Each entry after the header is imported as a Document.
+     *   This can only be used by Gen App Builder.
+     *
+     * Supported values for user even imports:
+     *
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] 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 document imports:
+     *
+     * * `document` (default): One JSON
+     * [Document][google.cloud.discoveryengine.v1alpha.Document] per line. Each
+     * document must
+     *   have a valid
+     *   [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+     * * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by
+     *   `input_uris` becomes a document, with the ID set to the first 128
+     *   bits of SHA256(URI) encoded as a hex string.
+     * * `custom`: One custom data JSON per row in arbitrary format that conforms
+     *   to the defined [Schema][google.cloud.discoveryengine.v1alpha.Schema] of
+     *   the data store. This can only be used by Gen App Builder.
+     * * `csv`: A CSV file with header conforming to the defined
+     * [Schema][google.cloud.discoveryengine.v1alpha.Schema] of the
+     *   data store. Each entry after the header is imported as a Document.
+     *   This can only be used by Gen App Builder.
+     *
+     * Supported values for user even imports:
+     *
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] 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 document imports:
+     *
+     * * `document` (default): One JSON
+     * [Document][google.cloud.discoveryengine.v1alpha.Document] per line. Each
+     * document must
+     *   have a valid
+     *   [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+     * * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by
+     *   `input_uris` becomes a document, with the ID set to the first 128
+     *   bits of SHA256(URI) encoded as a hex string.
+     * * `custom`: One custom data JSON per row in arbitrary format that conforms
+     *   to the defined [Schema][google.cloud.discoveryengine.v1alpha.Schema] of
+     *   the data store. This can only be used by Gen App Builder.
+     * * `csv`: A CSV file with header conforming to the defined
+     * [Schema][google.cloud.discoveryengine.v1alpha.Schema] of the
+     *   data store. Each entry after the header is imported as a Document.
+     *   This can only be used by Gen App Builder.
+     *
+     * Supported values for user even imports:
+     *
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     *
+     * Supported values for document imports:
+     *
+     * * `document` (default): One JSON
+     * [Document][google.cloud.discoveryengine.v1alpha.Document] per line. Each
+     * document must
+     *   have a valid
+     *   [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+     * * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by
+     *   `input_uris` becomes a document, with the ID set to the first 128
+     *   bits of SHA256(URI) encoded as a hex string.
+     * * `custom`: One custom data JSON per row in arbitrary format that conforms
+     *   to the defined [Schema][google.cloud.discoveryengine.v1alpha.Schema] of
+     *   the data store. This can only be used by Gen App Builder.
+     * * `csv`: A CSV file with header conforming to the defined
+     * [Schema][google.cloud.discoveryengine.v1alpha.Schema] of the
+     *   data store. Each entry after the header is imported as a Document.
+     *   This can only be used by Gen App Builder.
+     *
+     * Supported values for user even imports:
+     *
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] per line.
+     * 
+ * + * string data_schema = 2; + * + * @return This builder for chaining. + */ + public Builder clearDataSchema() { + dataSchema_ = getDefaultInstance().getDataSchema(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The schema to use when parsing the data from the source.
+     *
+     * Supported values for document imports:
+     *
+     * * `document` (default): One JSON
+     * [Document][google.cloud.discoveryengine.v1alpha.Document] per line. Each
+     * document must
+     *   have a valid
+     *   [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+     * * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by
+     *   `input_uris` becomes a document, with the ID set to the first 128
+     *   bits of SHA256(URI) encoded as a hex string.
+     * * `custom`: One custom data JSON per row in arbitrary format that conforms
+     *   to the defined [Schema][google.cloud.discoveryengine.v1alpha.Schema] of
+     *   the data store. This can only be used by Gen App Builder.
+     * * `csv`: A CSV file with header conforming to the defined
+     * [Schema][google.cloud.discoveryengine.v1alpha.Schema] of the
+     *   data store. Each entry after the header is imported as a Document.
+     *   This can only be used by Gen App Builder.
+     *
+     * Supported values for user even imports:
+     *
+     * * `user_event` (default): One JSON
+     * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] 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; + bitField0_ |= 0x00000002; + 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.discoveryengine.v1alpha.GcsSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.GcsSource) + private static final com.google.cloud.discoveryengine.v1alpha.GcsSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.GcsSource(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GcsSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GcsSourceOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GcsSourceOrBuilder.java new file mode 100644 index 000000000000..1bf465fea95b --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GcsSourceOrBuilder.java @@ -0,0 +1,175 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/import_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface GcsSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.GcsSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. 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 (or 100,000 files if `data_schema`
+   * is `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` is
+   * `content`).
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the inputUris. + */ + java.util.List getInputUrisList(); + /** + * + * + *
+   * Required. 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 (or 100,000 files if `data_schema`
+   * is `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` is
+   * `content`).
+   * 
+ * + * repeated string input_uris = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of inputUris. + */ + int getInputUrisCount(); + /** + * + * + *
+   * Required. 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 (or 100,000 files if `data_schema`
+   * is `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` is
+   * `content`).
+   * 
+ * + * 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. 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 (or 100,000 files if `data_schema`
+   * is `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` is
+   * `content`).
+   * 
+ * + * 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 document imports:
+   *
+   * * `document` (default): One JSON
+   * [Document][google.cloud.discoveryengine.v1alpha.Document] per line. Each
+   * document must
+   *   have a valid
+   *   [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+   * * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by
+   *   `input_uris` becomes a document, with the ID set to the first 128
+   *   bits of SHA256(URI) encoded as a hex string.
+   * * `custom`: One custom data JSON per row in arbitrary format that conforms
+   *   to the defined [Schema][google.cloud.discoveryengine.v1alpha.Schema] of
+   *   the data store. This can only be used by Gen App Builder.
+   * * `csv`: A CSV file with header conforming to the defined
+   * [Schema][google.cloud.discoveryengine.v1alpha.Schema] of the
+   *   data store. Each entry after the header is imported as a Document.
+   *   This can only be used by Gen App Builder.
+   *
+   * Supported values for user even imports:
+   *
+   * * `user_event` (default): One JSON
+   * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] 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 document imports:
+   *
+   * * `document` (default): One JSON
+   * [Document][google.cloud.discoveryengine.v1alpha.Document] per line. Each
+   * document must
+   *   have a valid
+   *   [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+   * * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by
+   *   `input_uris` becomes a document, with the ID set to the first 128
+   *   bits of SHA256(URI) encoded as a hex string.
+   * * `custom`: One custom data JSON per row in arbitrary format that conforms
+   *   to the defined [Schema][google.cloud.discoveryengine.v1alpha.Schema] of
+   *   the data store. This can only be used by Gen App Builder.
+   * * `csv`: A CSV file with header conforming to the defined
+   * [Schema][google.cloud.discoveryengine.v1alpha.Schema] of the
+   *   data store. Each entry after the header is imported as a Document.
+   *   This can only be used by Gen App Builder.
+   *
+   * Supported values for user even imports:
+   *
+   * * `user_event` (default): One JSON
+   * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] per line.
+   * 
+ * + * string data_schema = 2; + * + * @return The bytes for dataSchema. + */ + com.google.protobuf.ByteString getDataSchemaBytes(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetConversationRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetConversationRequest.java new file mode 100644 index 000000000000..51fb9098e363 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetConversationRequest.java @@ -0,0 +1,653 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request for GetConversation method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.GetConversationRequest} + */ +public final class GetConversationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.GetConversationRequest) + GetConversationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetConversationRequest.newBuilder() to construct. + private GetConversationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetConversationRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetConversationRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_GetConversationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_GetConversationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.GetConversationRequest.class, + com.google.cloud.discoveryengine.v1alpha.GetConversationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The resource name of the Conversation to get. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_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 Conversation to get. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_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_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.GetConversationRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.GetConversationRequest other = + (com.google.cloud.discoveryengine.v1alpha.GetConversationRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.GetConversationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetConversationRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetConversationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetConversationRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetConversationRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetConversationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetConversationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetConversationRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetConversationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetConversationRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetConversationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetConversationRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.GetConversationRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 GetConversation method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.GetConversationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.GetConversationRequest) + com.google.cloud.discoveryengine.v1alpha.GetConversationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_GetConversationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_GetConversationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.GetConversationRequest.class, + com.google.cloud.discoveryengine.v1alpha.GetConversationRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.GetConversationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_GetConversationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GetConversationRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.GetConversationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GetConversationRequest build() { + com.google.cloud.discoveryengine.v1alpha.GetConversationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GetConversationRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.GetConversationRequest result = + new com.google.cloud.discoveryengine.v1alpha.GetConversationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.GetConversationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.GetConversationRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.GetConversationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.GetConversationRequest other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.GetConversationRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the Conversation to get. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_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 Conversation to get. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_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 Conversation to get. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Conversation to get. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Conversation to get. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_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; + 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.discoveryengine.v1alpha.GetConversationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.GetConversationRequest) + private static final com.google.cloud.discoveryengine.v1alpha.GetConversationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.GetConversationRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetConversationRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetConversationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GetConversationRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetConversationRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetConversationRequestOrBuilder.java new file mode 100644 index 000000000000..24cc4fa8987c --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetConversationRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface GetConversationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.GetConversationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Conversation to get. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_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 Conversation to get. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetDocumentRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetDocumentRequest.java new file mode 100644 index 000000000000..c2693ef67aaf --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetDocumentRequest.java @@ -0,0 +1,706 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/document_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request message for
+ * [DocumentService.GetDocument][google.cloud.discoveryengine.v1alpha.DocumentService.GetDocument]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.GetDocumentRequest} + */ +public final class GetDocumentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.GetDocumentRequest) + GetDocumentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetDocumentRequest.newBuilder() to construct. + private GetDocumentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetDocumentRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetDocumentRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_GetDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_GetDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest.class, + com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Full resource name of
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
+   *
+   * If the caller does not have permission to access the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+   * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+   *
+   * If the requested [Document][google.cloud.discoveryengine.v1alpha.Document]
+   * 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
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
+   *
+   * If the caller does not have permission to access the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+   * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+   *
+   * If the requested [Document][google.cloud.discoveryengine.v1alpha.Document]
+   * 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_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest other = + (com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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
+   * [DocumentService.GetDocument][google.cloud.discoveryengine.v1alpha.DocumentService.GetDocument]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.GetDocumentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.GetDocumentRequest) + com.google.cloud.discoveryengine.v1alpha.GetDocumentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_GetDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_GetDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest.class, + com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_GetDocumentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest build() { + com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest result = + new com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest other) { + if (other == com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Full resource name of
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
+     *
+     * If the caller does not have permission to access the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * If the requested [Document][google.cloud.discoveryengine.v1alpha.Document]
+     * 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
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
+     *
+     * If the caller does not have permission to access the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * If the requested [Document][google.cloud.discoveryengine.v1alpha.Document]
+     * 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
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
+     *
+     * If the caller does not have permission to access the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * If the requested [Document][google.cloud.discoveryengine.v1alpha.Document]
+     * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
+     *
+     * If the caller does not have permission to access the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * If the requested [Document][google.cloud.discoveryengine.v1alpha.Document]
+     * 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(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
+     *
+     * If the caller does not have permission to access the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * If the requested [Document][google.cloud.discoveryengine.v1alpha.Document]
+     * 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; + 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.discoveryengine.v1alpha.GetDocumentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.GetDocumentRequest) + private static final com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetDocumentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetDocumentRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetDocumentRequestOrBuilder.java new file mode 100644 index 000000000000..e3a68c797855 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetDocumentRequestOrBuilder.java @@ -0,0 +1,72 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/document_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface GetDocumentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.GetDocumentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
+   *
+   * If the caller does not have permission to access the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+   * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+   *
+   * If the requested [Document][google.cloud.discoveryengine.v1alpha.Document]
+   * 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
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
+   *
+   * If the caller does not have permission to access the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+   * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+   *
+   * If the requested [Document][google.cloud.discoveryengine.v1alpha.Document]
+   * 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/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetSchemaRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetSchemaRequest.java new file mode 100644 index 000000000000..89274d2c6540 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetSchemaRequest.java @@ -0,0 +1,650 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request message for
+ * [SchemaService.GetSchema][google.cloud.discoveryengine.v1alpha.SchemaService.GetSchema]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.GetSchemaRequest} + */ +public final class GetSchemaRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.GetSchemaRequest) + GetSchemaRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetSchemaRequest.newBuilder() to construct. + private GetSchemaRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetSchemaRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetSchemaRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_GetSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_GetSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest.class, + com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The full resource name of the schema, in the format of
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+   * 
+ * + * + * 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 full resource name of the schema, in the format of
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+   * 
+ * + * + * 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_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest other = + (com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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
+   * [SchemaService.GetSchema][google.cloud.discoveryengine.v1alpha.SchemaService.GetSchema]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.GetSchemaRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.GetSchemaRequest) + com.google.cloud.discoveryengine.v1alpha.GetSchemaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_GetSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_GetSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest.class, + com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_GetSchemaRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest build() { + com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest result = + new com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest other) { + if (other == com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The full resource name of the schema, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+     * 
+ * + * + * 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 full resource name of the schema, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+     * 
+ * + * + * 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 full resource name of the schema, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The full resource name of the schema, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The full resource name of the schema, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+     * 
+ * + * + * 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; + 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.discoveryengine.v1alpha.GetSchemaRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.GetSchemaRequest) + private static final com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSchemaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetSchemaRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetSchemaRequestOrBuilder.java new file mode 100644 index 000000000000..3e5b66886b4a --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/GetSchemaRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface GetSchemaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.GetSchemaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The full resource name of the schema, in the format of
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The full resource name of the schema, in the format of
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportConfigProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportConfigProto.java new file mode 100644 index 000000000000..ab7c5cef78d1 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportConfigProto.java @@ -0,0 +1,292 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/import_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +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_discoveryengine_v1alpha_GcsSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_GcsSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_BigQuerySource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_BigQuerySource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_ImportErrorConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_ImportErrorConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsRequest_InlineSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsRequest_InlineSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsRequest_InlineSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsRequest_InlineSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsResponse_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/discoveryengine/v1alpha/i" + + "mport_config.proto\022$google.cloud.discove" + + "ryengine.v1alpha\032\037google/api/field_behav" + + "ior.proto\032\031google/api/resource.proto\0323go" + + "ogle/cloud/discoveryengine/v1alpha/docum" + + "ent.proto\0325google/cloud/discoveryengine/" + + "v1alpha/user_event.proto\032\037google/protobu" + + "f/timestamp.proto\032\027google/rpc/status.pro" + + "to\032\026google/type/date.proto\":\n\tGcsSource\022" + + "\030\n\ninput_uris\030\001 \003(\tB\004\342A\001\002\022\023\n\013data_schema" + + "\030\002 \001(\t\"\276\001\n\016BigQuerySource\022+\n\016partition_d" + + "ate\030\005 \001(\0132\021.google.type.DateH\000\022\022\n\nprojec" + + "t_id\030\001 \001(\t\022\030\n\ndataset_id\030\002 \001(\tB\004\342A\001\002\022\026\n\010" + + "table_id\030\003 \001(\tB\004\342A\001\002\022\027\n\017gcs_staging_dir\030" + + "\004 \001(\t\022\023\n\013data_schema\030\006 \001(\tB\013\n\tpartition\"" + + "8\n\021ImportErrorConfig\022\024\n\ngcs_prefix\030\001 \001(\t" + + "H\000B\r\n\013destination\"\216\004\n\027ImportUserEventsRe" + + "quest\022c\n\rinline_source\030\002 \001(\0132J.google.cl" + + "oud.discoveryengine.v1alpha.ImportUserEv" + + "entsRequest.InlineSourceH\000\022E\n\ngcs_source" + + "\030\003 \001(\0132/.google.cloud.discoveryengine.v1" + + "alpha.GcsSourceH\000\022O\n\017bigquery_source\030\004 \001" + + "(\01324.google.cloud.discoveryengine.v1alph" + + "a.BigQuerySourceH\000\022A\n\006parent\030\001 \001(\tB1\342A\001\002" + + "\372A*\n(discoveryengine.googleapis.com/Data" + + "Store\022M\n\014error_config\030\005 \001(\01327.google.clo" + + "ud.discoveryengine.v1alpha.ImportErrorCo" + + "nfig\032Z\n\014InlineSource\022J\n\013user_events\030\001 \003(" + + "\0132/.google.cloud.discoveryengine.v1alpha" + + ".UserEventB\004\342A\001\002B\010\n\006source\"\320\001\n\030ImportUse" + + "rEventsResponse\022)\n\rerror_samples\030\001 \003(\0132\022" + + ".google.rpc.Status\022M\n\014error_config\030\002 \001(\013" + + "27.google.cloud.discoveryengine.v1alpha." + + "ImportErrorConfig\022\033\n\023joined_events_count" + + "\030\003 \001(\003\022\035\n\025unjoined_events_count\030\004 \001(\003\"\252\001" + + "\n\030ImportUserEventsMetadata\022/\n\013create_tim" + + "e\030\001 \001(\0132\032.google.protobuf.Timestamp\022/\n\013u" + + "pdate_time\030\002 \001(\0132\032.google.protobuf.Times" + + "tamp\022\025\n\rsuccess_count\030\003 \001(\003\022\025\n\rfailure_c" + + "ount\030\004 \001(\003\"\251\001\n\027ImportDocumentsMetadata\022/" + + "\n\013create_time\030\001 \001(\0132\032.google.protobuf.Ti" + + "mestamp\022/\n\013update_time\030\002 \001(\0132\032.google.pr" + + "otobuf.Timestamp\022\025\n\rsuccess_count\030\003 \001(\003\022" + + "\025\n\rfailure_count\030\004 \001(\003\"\367\005\n\026ImportDocumen" + + "tsRequest\022b\n\rinline_source\030\002 \001(\0132I.googl" + + "e.cloud.discoveryengine.v1alpha.ImportDo" + + "cumentsRequest.InlineSourceH\000\022E\n\ngcs_sou" + + "rce\030\003 \001(\0132/.google.cloud.discoveryengine" + + ".v1alpha.GcsSourceH\000\022O\n\017bigquery_source\030" + + "\004 \001(\01324.google.cloud.discoveryengine.v1a" + + "lpha.BigQuerySourceH\000\022>\n\006parent\030\001 \001(\tB.\342" + + "A\001\002\372A\'\n%discoveryengine.googleapis.com/B" + + "ranch\022M\n\014error_config\030\005 \001(\01327.google.clo" + + "ud.discoveryengine.v1alpha.ImportErrorCo" + + "nfig\022l\n\023reconciliation_mode\030\006 \001(\0162O.goog" + + "le.cloud.discoveryengine.v1alpha.ImportD" + + "ocumentsRequest.ReconciliationMode\022\031\n\021au" + + "to_generate_ids\030\010 \001(\010\022\020\n\010id_field\030\t \001(\t\032" + + "W\n\014InlineSource\022G\n\tdocuments\030\001 \003(\0132..goo" + + "gle.cloud.discoveryengine.v1alpha.Docume" + + "ntB\004\342A\001\002\"T\n\022ReconciliationMode\022#\n\037RECONC" + + "ILIATION_MODE_UNSPECIFIED\020\000\022\017\n\013INCREMENT" + + "AL\020\001\022\010\n\004FULL\020\002B\010\n\006source\"\223\001\n\027ImportDocum" + + "entsResponse\022)\n\rerror_samples\030\001 \003(\0132\022.go" + + "ogle.rpc.Status\022M\n\014error_config\030\002 \001(\01327." + + "google.cloud.discoveryengine.v1alpha.Imp" + + "ortErrorConfigB\235\002\n(com.google.cloud.disc" + + "overyengine.v1alphaB\021ImportConfigProtoP\001" + + "ZRcloud.google.com/go/discoveryengine/ap" + + "iv1alpha/discoveryenginepb;discoveryengi" + + "nepb\242\002\017DISCOVERYENGINE\252\002$Google.Cloud.Di" + + "scoveryEngine.V1Alpha\312\002$Google\\Cloud\\Dis" + + "coveryEngine\\V1alpha\352\002\'Google::Cloud::Di" + + "scoveryEngine::V1alphab\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.discoveryengine.v1alpha.DocumentProto.getDescriptor(), + com.google.cloud.discoveryengine.v1alpha.UserEventProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + com.google.type.DateProto.getDescriptor(), + }); + internal_static_google_cloud_discoveryengine_v1alpha_GcsSource_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_discoveryengine_v1alpha_GcsSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_GcsSource_descriptor, + new java.lang.String[] { + "InputUris", "DataSchema", + }); + internal_static_google_cloud_discoveryengine_v1alpha_BigQuerySource_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_discoveryengine_v1alpha_BigQuerySource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_BigQuerySource_descriptor, + new java.lang.String[] { + "PartitionDate", + "ProjectId", + "DatasetId", + "TableId", + "GcsStagingDir", + "DataSchema", + "Partition", + }); + internal_static_google_cloud_discoveryengine_v1alpha_ImportErrorConfig_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_discoveryengine_v1alpha_ImportErrorConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_ImportErrorConfig_descriptor, + new java.lang.String[] { + "GcsPrefix", "Destination", + }); + internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsRequest_descriptor, + new java.lang.String[] { + "InlineSource", "GcsSource", "BigquerySource", "Parent", "ErrorConfig", "Source", + }); + internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsRequest_InlineSource_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsRequest_InlineSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsRequest_InlineSource_descriptor, + new java.lang.String[] { + "UserEvents", + }); + internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsResponse_descriptor, + new java.lang.String[] { + "ErrorSamples", "ErrorConfig", "JoinedEventsCount", "UnjoinedEventsCount", + }); + internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsMetadata_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsMetadata_descriptor, + new java.lang.String[] { + "CreateTime", "UpdateTime", "SuccessCount", "FailureCount", + }); + internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsMetadata_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsMetadata_descriptor, + new java.lang.String[] { + "CreateTime", "UpdateTime", "SuccessCount", "FailureCount", + }); + internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsRequest_descriptor, + new java.lang.String[] { + "InlineSource", + "GcsSource", + "BigquerySource", + "Parent", + "ErrorConfig", + "ReconciliationMode", + "AutoGenerateIds", + "IdField", + "Source", + }); + internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsRequest_InlineSource_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsRequest_InlineSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsRequest_InlineSource_descriptor, + new java.lang.String[] { + "Documents", + }); + internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsResponse_descriptor, + new java.lang.String[] { + "ErrorSamples", "ErrorConfig", + }); + 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.discoveryengine.v1alpha.DocumentProto.getDescriptor(); + com.google.cloud.discoveryengine.v1alpha.UserEventProto.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/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsMetadata.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsMetadata.java new file mode 100644 index 000000000000..eaaa563b9478 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsMetadata.java @@ -0,0 +1,1169 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/import_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Metadata related to the progress of the ImportDocuments operation. This is
+ * returned by the google.longrunning.Operation.metadata field.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata} + */ +public final class ImportDocumentsMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata) + ImportDocumentsMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportDocumentsMetadata.newBuilder() to construct. + private ImportDocumentsMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportDocumentsMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportDocumentsMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata.class, + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata.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 createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + 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 updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int SUCCESS_COUNT_FIELD_NUMBER = 3; + private long successCount_ = 0L; + /** + * + * + *
+   * 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_ = 0L; + /** + * + * + *
+   * 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_); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata other = + (com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata) 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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 ImportDocuments operation. This is
+   * returned by the google.longrunning.Operation.metadata field.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata) + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata.class, + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + successCount_ = 0L; + failureCount_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata build() { + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata buildPartial() { + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata result = + new com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.successCount_ = successCount_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.failureCount_ = failureCount_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata.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.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + successCount_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + failureCount_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private 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 ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * 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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + 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(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000001); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000001; + 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 ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * 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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + 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(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + 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 (((bitField0_ & 0x00000002) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + 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() { + bitField0_ = (bitField0_ & ~0x00000002); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + 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() { + bitField0_ |= 0x00000002; + 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of entries that were processed successfully.
+     * 
+ * + * int64 success_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearSuccessCount() { + bitField0_ = (bitField0_ & ~0x00000004); + 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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of entries that encountered errors while processing.
+     * 
+ * + * int64 failure_count = 4; + * + * @return This builder for chaining. + */ + public Builder clearFailureCount() { + bitField0_ = (bitField0_ & ~0x00000008); + 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.discoveryengine.v1alpha.ImportDocumentsMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata) + private static final com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata(); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportDocumentsMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsMetadataOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsMetadataOrBuilder.java new file mode 100644 index 000000000000..bd1e73b5b86b --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsMetadataOrBuilder.java @@ -0,0 +1,124 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/import_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface ImportDocumentsMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata) + 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(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsRequest.java new file mode 100644 index 000000000000..f6c74ab7ac81 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsRequest.java @@ -0,0 +1,3997 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/import_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request message for Import methods.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest} + */ +public final class ImportDocumentsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest) + ImportDocumentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportDocumentsRequest.newBuilder() to construct. + private ImportDocumentsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportDocumentsRequest() { + parent_ = ""; + reconciliationMode_ = 0; + idField_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportDocumentsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.class, + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.Builder.class); + } + + /** + * + * + *
+   * Indicates how imported documents are reconciled with the existing documents
+   * created or imported before.
+   * 
+ * + * Protobuf enum {@code + * google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode} + */ + public enum ReconciliationMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Defaults to `INCREMENTAL`.
+     * 
+ * + * RECONCILIATION_MODE_UNSPECIFIED = 0; + */ + RECONCILIATION_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Inserts new documents or updates existing documents.
+     * 
+ * + * INCREMENTAL = 1; + */ + INCREMENTAL(1), + /** + * + * + *
+     * Calculates diff and replaces the entire document dataset. Existing
+     * documents may be deleted if they are not present in the source location.
+     * 
+ * + * FULL = 2; + */ + FULL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Defaults to `INCREMENTAL`.
+     * 
+ * + * RECONCILIATION_MODE_UNSPECIFIED = 0; + */ + public static final int RECONCILIATION_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Inserts new documents or updates existing documents.
+     * 
+ * + * INCREMENTAL = 1; + */ + public static final int INCREMENTAL_VALUE = 1; + /** + * + * + *
+     * Calculates diff and replaces the entire document dataset. Existing
+     * documents may be deleted if they are not present in the source location.
+     * 
+ * + * 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.discoveryengine.v1alpha.ImportDocumentsRequest.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.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode) + } + + public interface InlineSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. A list of documents to update/create. Each document must have a
+     * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+     * Recommended max of 100 items.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getDocumentsList(); + /** + * + * + *
+     * Required. A list of documents to update/create. Each document must have a
+     * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+     * Recommended max of 100 items.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.discoveryengine.v1alpha.Document getDocuments(int index); + /** + * + * + *
+     * Required. A list of documents to update/create. Each document must have a
+     * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+     * Recommended max of 100 items.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getDocumentsCount(); + /** + * + * + *
+     * Required. A list of documents to update/create. Each document must have a
+     * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+     * Recommended max of 100 items.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getDocumentsOrBuilderList(); + /** + * + * + *
+     * Required. A list of documents to update/create. Each document must have a
+     * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+     * Recommended max of 100 items.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder getDocumentsOrBuilder(int index); + } + /** + * + * + *
+   * The inline source for the input config for ImportDocuments method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource} + */ + public static final class InlineSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource) + InlineSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use InlineSource.newBuilder() to construct. + private InlineSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InlineSource() { + documents_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InlineSource(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsRequest_InlineSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsRequest_InlineSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.class, + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.Builder + .class); + } + + public static final int DOCUMENTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List documents_; + /** + * + * + *
+     * Required. A list of documents to update/create. Each document must have a
+     * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+     * Recommended max of 100 items.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getDocumentsList() { + return documents_; + } + /** + * + * + *
+     * Required. A list of documents to update/create. Each document must have a
+     * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+     * Recommended max of 100 items.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getDocumentsOrBuilderList() { + return documents_; + } + /** + * + * + *
+     * Required. A list of documents to update/create. Each document must have a
+     * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+     * Recommended max of 100 items.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getDocumentsCount() { + return documents_.size(); + } + /** + * + * + *
+     * Required. A list of documents to update/create. Each document must have a
+     * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+     * Recommended max of 100 items.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Document getDocuments(int index) { + return documents_.get(index); + } + /** + * + * + *
+     * Required. A list of documents to update/create. Each document must have a
+     * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+     * Recommended max of 100 items.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder getDocumentsOrBuilder( + int index) { + return documents_.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 < documents_.size(); i++) { + output.writeMessage(1, documents_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < documents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, documents_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource other = + (com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource) obj; + + if (!getDocumentsList().equals(other.getDocumentsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDocumentsCount() > 0) { + hash = (37 * hash) + DOCUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getDocumentsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 ImportDocuments method.
+     * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource) + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsRequest_InlineSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsRequest_InlineSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.class, + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.Builder + .class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (documentsBuilder_ == null) { + documents_ = java.util.Collections.emptyList(); + } else { + documents_ = null; + documentsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsRequest_InlineSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource build() { + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + buildPartial() { + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource result = + new com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource result) { + if (documentsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + documents_ = java.util.Collections.unmodifiableList(documents_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.documents_ = documents_; + } else { + result.documents_ = documentsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + .getDefaultInstance()) return this; + if (documentsBuilder_ == null) { + if (!other.documents_.isEmpty()) { + if (documents_.isEmpty()) { + documents_ = other.documents_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDocumentsIsMutable(); + documents_.addAll(other.documents_); + } + onChanged(); + } + } else { + if (!other.documents_.isEmpty()) { + if (documentsBuilder_.isEmpty()) { + documentsBuilder_.dispose(); + documentsBuilder_ = null; + documents_ = other.documents_; + bitField0_ = (bitField0_ & ~0x00000001); + documentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDocumentsFieldBuilder() + : null; + } else { + documentsBuilder_.addAllMessages(other.documents_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.discoveryengine.v1alpha.Document m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.Document.parser(), + extensionRegistry); + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + documents_.add(m); + } else { + documentsBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List documents_ = + java.util.Collections.emptyList(); + + private void ensureDocumentsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + documents_ = + new java.util.ArrayList( + documents_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Document, + com.google.cloud.discoveryengine.v1alpha.Document.Builder, + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder> + documentsBuilder_; + + /** + * + * + *
+       * Required. A list of documents to update/create. Each document must have a
+       * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+       * Recommended max of 100 items.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getDocumentsList() { + if (documentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(documents_); + } else { + return documentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Required. A list of documents to update/create. Each document must have a
+       * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+       * Recommended max of 100 items.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getDocumentsCount() { + if (documentsBuilder_ == null) { + return documents_.size(); + } else { + return documentsBuilder_.getCount(); + } + } + /** + * + * + *
+       * Required. A list of documents to update/create. Each document must have a
+       * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+       * Recommended max of 100 items.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.Document getDocuments(int index) { + if (documentsBuilder_ == null) { + return documents_.get(index); + } else { + return documentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Required. A list of documents to update/create. Each document must have a
+       * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+       * Recommended max of 100 items.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDocuments( + int index, com.google.cloud.discoveryengine.v1alpha.Document value) { + if (documentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentsIsMutable(); + documents_.set(index, value); + onChanged(); + } else { + documentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Required. A list of documents to update/create. Each document must have a
+       * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+       * Recommended max of 100 items.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDocuments( + int index, com.google.cloud.discoveryengine.v1alpha.Document.Builder builderForValue) { + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + documents_.set(index, builderForValue.build()); + onChanged(); + } else { + documentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Required. A list of documents to update/create. Each document must have a
+       * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+       * Recommended max of 100 items.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addDocuments(com.google.cloud.discoveryengine.v1alpha.Document value) { + if (documentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentsIsMutable(); + documents_.add(value); + onChanged(); + } else { + documentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Required. A list of documents to update/create. Each document must have a
+       * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+       * Recommended max of 100 items.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addDocuments( + int index, com.google.cloud.discoveryengine.v1alpha.Document value) { + if (documentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentsIsMutable(); + documents_.add(index, value); + onChanged(); + } else { + documentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Required. A list of documents to update/create. Each document must have a
+       * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+       * Recommended max of 100 items.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addDocuments( + com.google.cloud.discoveryengine.v1alpha.Document.Builder builderForValue) { + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + documents_.add(builderForValue.build()); + onChanged(); + } else { + documentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Required. A list of documents to update/create. Each document must have a
+       * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+       * Recommended max of 100 items.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addDocuments( + int index, com.google.cloud.discoveryengine.v1alpha.Document.Builder builderForValue) { + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + documents_.add(index, builderForValue.build()); + onChanged(); + } else { + documentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Required. A list of documents to update/create. Each document must have a
+       * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+       * Recommended max of 100 items.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllDocuments( + java.lang.Iterable values) { + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, documents_); + onChanged(); + } else { + documentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Required. A list of documents to update/create. Each document must have a
+       * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+       * Recommended max of 100 items.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDocuments() { + if (documentsBuilder_ == null) { + documents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + documentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Required. A list of documents to update/create. Each document must have a
+       * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+       * Recommended max of 100 items.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeDocuments(int index) { + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + documents_.remove(index); + onChanged(); + } else { + documentsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Required. A list of documents to update/create. Each document must have a
+       * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+       * Recommended max of 100 items.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.Document.Builder getDocumentsBuilder( + int index) { + return getDocumentsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Required. A list of documents to update/create. Each document must have a
+       * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+       * Recommended max of 100 items.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder getDocumentsOrBuilder( + int index) { + if (documentsBuilder_ == null) { + return documents_.get(index); + } else { + return documentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Required. A list of documents to update/create. Each document must have a
+       * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+       * Recommended max of 100 items.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getDocumentsOrBuilderList() { + if (documentsBuilder_ != null) { + return documentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(documents_); + } + } + /** + * + * + *
+       * Required. A list of documents to update/create. Each document must have a
+       * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+       * Recommended max of 100 items.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.Document.Builder addDocumentsBuilder() { + return getDocumentsFieldBuilder() + .addBuilder(com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance()); + } + /** + * + * + *
+       * Required. A list of documents to update/create. Each document must have a
+       * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+       * Recommended max of 100 items.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.Document.Builder addDocumentsBuilder( + int index) { + return getDocumentsFieldBuilder() + .addBuilder( + index, com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance()); + } + /** + * + * + *
+       * Required. A list of documents to update/create. Each document must have a
+       * valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id].
+       * Recommended max of 100 items.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getDocumentsBuilderList() { + return getDocumentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Document, + com.google.cloud.discoveryengine.v1alpha.Document.Builder, + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder> + getDocumentsFieldBuilder() { + if (documentsBuilder_ == null) { + documentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Document, + com.google.cloud.discoveryengine.v1alpha.Document.Builder, + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder>( + documents_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + documents_ = null; + } + return documentsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource) + private static final com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + .InlineSource + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource(); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InlineSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int sourceCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + INLINE_SOURCE(2), + GCS_SOURCE(3), + BIGQUERY_SOURCE(4), + 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 2: + return INLINE_SOURCE; + case 3: + return GCS_SOURCE; + case 4: + return BIGQUERY_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 INLINE_SOURCE_FIELD_NUMBER = 2; + /** + * + * + *
+   * The Inline source for the input content for documents.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource inline_source = 2; + * + * + * @return Whether the inlineSource field is set. + */ + @java.lang.Override + public boolean hasInlineSource() { + return sourceCase_ == 2; + } + /** + * + * + *
+   * The Inline source for the input content for documents.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource inline_source = 2; + * + * + * @return The inlineSource. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + getInlineSource() { + if (sourceCase_ == 2) { + return (com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource) source_; + } + return com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + .getDefaultInstance(); + } + /** + * + * + *
+   * The Inline source for the input content for documents.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource inline_source = 2; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSourceOrBuilder + getInlineSourceOrBuilder() { + if (sourceCase_ == 2) { + return (com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource) source_; + } + return com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + .getDefaultInstance(); + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 3; + /** + * + * + *
+   * Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return sourceCase_ == 3; + } + /** + * + * + *
+   * Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GcsSource getGcsSource() { + if (sourceCase_ == 3) { + return (com.google.cloud.discoveryengine.v1alpha.GcsSource) source_; + } + return com.google.cloud.discoveryengine.v1alpha.GcsSource.getDefaultInstance(); + } + /** + * + * + *
+   * Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (sourceCase_ == 3) { + return (com.google.cloud.discoveryengine.v1alpha.GcsSource) source_; + } + return com.google.cloud.discoveryengine.v1alpha.GcsSource.getDefaultInstance(); + } + + public static final int BIGQUERY_SOURCE_FIELD_NUMBER = 4; + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + * + * @return Whether the bigquerySource field is set. + */ + @java.lang.Override + public boolean hasBigquerySource() { + return sourceCase_ == 4; + } + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + * + * @return The bigquerySource. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.BigQuerySource getBigquerySource() { + if (sourceCase_ == 4) { + return (com.google.cloud.discoveryengine.v1alpha.BigQuerySource) source_; + } + return com.google.cloud.discoveryengine.v1alpha.BigQuerySource.getDefaultInstance(); + } + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.BigQuerySourceOrBuilder + getBigquerySourceOrBuilder() { + if (sourceCase_ == 4) { + return (com.google.cloud.discoveryengine.v1alpha.BigQuerySource) source_; + } + return com.google.cloud.discoveryengine.v1alpha.BigQuerySource.getDefaultInstance(); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent branch resource name, such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+   * Requires create/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. The parent branch resource name, such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+   * Requires create/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 ERROR_CONFIG_FIELD_NUMBER = 5; + private com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig errorConfig_; + /** + * + * + *
+   * The desired location of errors incurred during the Import.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + * + * @return Whether the errorConfig field is set. + */ + @java.lang.Override + public boolean hasErrorConfig() { + return errorConfig_ != null; + } + /** + * + * + *
+   * The desired location of errors incurred during the Import.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + * + * @return The errorConfig. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig getErrorConfig() { + return errorConfig_ == null + ? com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.getDefaultInstance() + : errorConfig_; + } + /** + * + * + *
+   * The desired location of errors incurred during the Import.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder + getErrorConfigOrBuilder() { + return errorConfig_ == null + ? com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.getDefaultInstance() + : errorConfig_; + } + + public static final int RECONCILIATION_MODE_FIELD_NUMBER = 6; + private int reconciliationMode_ = 0; + /** + * + * + *
+   * The mode of reconciliation between existing documents and the documents to
+   * be imported. Defaults to
+   * [ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL].
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode reconciliation_mode = 6; + * + * + * @return The enum numeric value on the wire for reconciliationMode. + */ + @java.lang.Override + public int getReconciliationModeValue() { + return reconciliationMode_; + } + /** + * + * + *
+   * The mode of reconciliation between existing documents and the documents to
+   * be imported. Defaults to
+   * [ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL].
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode reconciliation_mode = 6; + * + * + * @return The reconciliationMode. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode + getReconciliationMode() { + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode result = + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode + .forNumber(reconciliationMode_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode + .UNRECOGNIZED + : result; + } + + public static final int AUTO_GENERATE_IDS_FIELD_NUMBER = 8; + private boolean autoGenerateIds_ = false; + /** + * + * + *
+   * Whether to automatically generate IDs for the documents if absent.
+   *
+   * If set to `true`,
+   * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s are
+   * automatically generated based on the hash of the payload, where IDs may not
+   * be consistent during multiple imports. In which case
+   * [ReconciliationMode.FULL][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode.FULL]
+   * is highly recommended to avoid duplicate contents. If unset or set to
+   * `false`, [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s
+   * have to be specified using
+   * [id_field][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.id_field],
+   * otherwise, documents without IDs fail to be imported.
+   *
+   * Only set this field when using
+   * [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] or
+   * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource], and
+   * when
+   * [GcsSource.data_schema][google.cloud.discoveryengine.v1alpha.GcsSource.data_schema]
+   * or
+   * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema]
+   * is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
+   * 
+ * + * bool auto_generate_ids = 8; + * + * @return The autoGenerateIds. + */ + @java.lang.Override + public boolean getAutoGenerateIds() { + return autoGenerateIds_; + } + + public static final int ID_FIELD_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object idField_ = ""; + /** + * + * + *
+   * The field in the Cloud Storage and BigQuery sources that indicates the
+   * unique IDs of the documents.
+   *
+   * For [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] it is the
+   * key of the JSON field. For instance, `my_id` for JSON `{"my_id":
+   * "some_uuid"}`. For
+   * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource] it is
+   * the column name of the BigQuery table where the unique ids are stored.
+   *
+   * The values of the JSON field or the BigQuery column are used as the
+   * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s. The JSON
+   * field or the BigQuery column must be of string type, and the values must be
+   * set as valid strings conform to
+   * [RFC-1034](https://tools.ietf.org/html/rfc1034) with 1-63 characters.
+   * Otherwise, documents without valid IDs fail to be imported.
+   *
+   * Only set this field when using
+   * [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] or
+   * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource], and
+   * when
+   * [GcsSource.data_schema][google.cloud.discoveryengine.v1alpha.GcsSource.data_schema]
+   * or
+   * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema]
+   * is `custom`. And only set this field when
+   * [auto_generate_ids][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.auto_generate_ids]
+   * is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown.
+   *
+   * If it is unset, a default value `_id` is used when importing from the
+   * allowed data sources.
+   * 
+ * + * string id_field = 9; + * + * @return The idField. + */ + @java.lang.Override + public java.lang.String getIdField() { + java.lang.Object ref = idField_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + idField_ = s; + return s; + } + } + /** + * + * + *
+   * The field in the Cloud Storage and BigQuery sources that indicates the
+   * unique IDs of the documents.
+   *
+   * For [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] it is the
+   * key of the JSON field. For instance, `my_id` for JSON `{"my_id":
+   * "some_uuid"}`. For
+   * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource] it is
+   * the column name of the BigQuery table where the unique ids are stored.
+   *
+   * The values of the JSON field or the BigQuery column are used as the
+   * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s. The JSON
+   * field or the BigQuery column must be of string type, and the values must be
+   * set as valid strings conform to
+   * [RFC-1034](https://tools.ietf.org/html/rfc1034) with 1-63 characters.
+   * Otherwise, documents without valid IDs fail to be imported.
+   *
+   * Only set this field when using
+   * [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] or
+   * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource], and
+   * when
+   * [GcsSource.data_schema][google.cloud.discoveryengine.v1alpha.GcsSource.data_schema]
+   * or
+   * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema]
+   * is `custom`. And only set this field when
+   * [auto_generate_ids][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.auto_generate_ids]
+   * is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown.
+   *
+   * If it is unset, a default value `_id` is used when importing from the
+   * allowed data sources.
+   * 
+ * + * string id_field = 9; + * + * @return The bytes for idField. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdFieldBytes() { + java.lang.Object ref = idField_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + idField_ = 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 (sourceCase_ == 2) { + output.writeMessage( + 2, + (com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource) source_); + } + if (sourceCase_ == 3) { + output.writeMessage(3, (com.google.cloud.discoveryengine.v1alpha.GcsSource) source_); + } + if (sourceCase_ == 4) { + output.writeMessage(4, (com.google.cloud.discoveryengine.v1alpha.BigQuerySource) source_); + } + if (errorConfig_ != null) { + output.writeMessage(5, getErrorConfig()); + } + if (reconciliationMode_ + != com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode + .RECONCILIATION_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(6, reconciliationMode_); + } + if (autoGenerateIds_ != false) { + output.writeBool(8, autoGenerateIds_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(idField_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, idField_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (sourceCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, + (com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource) + source_); + } + if (sourceCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.discoveryengine.v1alpha.GcsSource) source_); + } + if (sourceCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.discoveryengine.v1alpha.BigQuerySource) source_); + } + if (errorConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getErrorConfig()); + } + if (reconciliationMode_ + != com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode + .RECONCILIATION_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, reconciliationMode_); + } + if (autoGenerateIds_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(8, autoGenerateIds_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(idField_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, idField_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest other = + (com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasErrorConfig() != other.hasErrorConfig()) return false; + if (hasErrorConfig()) { + if (!getErrorConfig().equals(other.getErrorConfig())) return false; + } + if (reconciliationMode_ != other.reconciliationMode_) return false; + if (getAutoGenerateIds() != other.getAutoGenerateIds()) return false; + if (!getIdField().equals(other.getIdField())) return false; + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 2: + if (!getInlineSource().equals(other.getInlineSource())) return false; + break; + case 3: + if (!getGcsSource().equals(other.getGcsSource())) return false; + break; + case 4: + if (!getBigquerySource().equals(other.getBigquerySource())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasErrorConfig()) { + hash = (37 * hash) + ERROR_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getErrorConfig().hashCode(); + } + hash = (37 * hash) + RECONCILIATION_MODE_FIELD_NUMBER; + hash = (53 * hash) + reconciliationMode_; + hash = (37 * hash) + AUTO_GENERATE_IDS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAutoGenerateIds()); + hash = (37 * hash) + ID_FIELD_FIELD_NUMBER; + hash = (53 * hash) + getIdField().hashCode(); + switch (sourceCase_) { + case 2: + hash = (37 * hash) + INLINE_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getInlineSource().hashCode(); + break; + case 3: + hash = (37 * hash) + GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getGcsSource().hashCode(); + break; + case 4: + hash = (37 * hash) + BIGQUERY_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getBigquerySource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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.discoveryengine.v1alpha.ImportDocumentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest) + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.class, + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (inlineSourceBuilder_ != null) { + inlineSourceBuilder_.clear(); + } + if (gcsSourceBuilder_ != null) { + gcsSourceBuilder_.clear(); + } + if (bigquerySourceBuilder_ != null) { + bigquerySourceBuilder_.clear(); + } + parent_ = ""; + errorConfig_ = null; + if (errorConfigBuilder_ != null) { + errorConfigBuilder_.dispose(); + errorConfigBuilder_ = null; + } + reconciliationMode_ = 0; + autoGenerateIds_ = false; + idField_ = ""; + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest build() { + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest result = + new com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.errorConfig_ = + errorConfigBuilder_ == null ? errorConfig_ : errorConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.reconciliationMode_ = reconciliationMode_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.autoGenerateIds_ = autoGenerateIds_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.idField_ = idField_; + } + } + + private void buildPartialOneofs( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest result) { + result.sourceCase_ = sourceCase_; + result.source_ = this.source_; + if (sourceCase_ == 2 && inlineSourceBuilder_ != null) { + result.source_ = inlineSourceBuilder_.build(); + } + if (sourceCase_ == 3 && gcsSourceBuilder_ != null) { + result.source_ = gcsSourceBuilder_.build(); + } + if (sourceCase_ == 4 && bigquerySourceBuilder_ != null) { + result.source_ = bigquerySourceBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasErrorConfig()) { + mergeErrorConfig(other.getErrorConfig()); + } + if (other.reconciliationMode_ != 0) { + setReconciliationModeValue(other.getReconciliationModeValue()); + } + if (other.getAutoGenerateIds() != false) { + setAutoGenerateIds(other.getAutoGenerateIds()); + } + if (!other.getIdField().isEmpty()) { + idField_ = other.idField_; + bitField0_ |= 0x00000080; + onChanged(); + } + switch (other.getSourceCase()) { + case INLINE_SOURCE: + { + mergeInlineSource(other.getInlineSource()); + break; + } + case GCS_SOURCE: + { + mergeGcsSource(other.getGcsSource()); + break; + } + case BIGQUERY_SOURCE: + { + mergeBigquerySource(other.getBigquerySource()); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 10 + case 18: + { + input.readMessage(getInlineSourceFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getGcsSourceFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage(getBigquerySourceFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage(getErrorConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + reconciliationMode_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 64: + { + autoGenerateIds_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 64 + case 74: + { + idField_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int 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 int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource, + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.Builder, + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSourceOrBuilder> + inlineSourceBuilder_; + /** + * + * + *
+     * The Inline source for the input content for documents.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource inline_source = 2; + * + * + * @return Whether the inlineSource field is set. + */ + @java.lang.Override + public boolean hasInlineSource() { + return sourceCase_ == 2; + } + /** + * + * + *
+     * The Inline source for the input content for documents.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource inline_source = 2; + * + * + * @return The inlineSource. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + getInlineSource() { + if (inlineSourceBuilder_ == null) { + if (sourceCase_ == 2) { + return (com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource) + source_; + } + return com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + .getDefaultInstance(); + } else { + if (sourceCase_ == 2) { + return inlineSourceBuilder_.getMessage(); + } + return com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + .getDefaultInstance(); + } + } + /** + * + * + *
+     * The Inline source for the input content for documents.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource inline_source = 2; + * + */ + public Builder setInlineSource( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource value) { + if (inlineSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + inlineSourceBuilder_.setMessage(value); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * The Inline source for the input content for documents.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource inline_source = 2; + * + */ + public Builder setInlineSource( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.Builder + builderForValue) { + if (inlineSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + inlineSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * The Inline source for the input content for documents.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource inline_source = 2; + * + */ + public Builder mergeInlineSource( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource value) { + if (inlineSourceBuilder_ == null) { + if (sourceCase_ == 2 + && source_ + != com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + .getDefaultInstance()) { + source_ = + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + .newBuilder( + (com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource) + source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 2) { + inlineSourceBuilder_.mergeFrom(value); + } else { + inlineSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * The Inline source for the input content for documents.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource inline_source = 2; + * + */ + public Builder clearInlineSource() { + if (inlineSourceBuilder_ == null) { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + } + inlineSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The Inline source for the input content for documents.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource inline_source = 2; + * + */ + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.Builder + getInlineSourceBuilder() { + return getInlineSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Inline source for the input content for documents.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource inline_source = 2; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSourceOrBuilder + getInlineSourceOrBuilder() { + if ((sourceCase_ == 2) && (inlineSourceBuilder_ != null)) { + return inlineSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 2) { + return (com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource) + source_; + } + return com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + .getDefaultInstance(); + } + } + /** + * + * + *
+     * The Inline source for the input content for documents.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource inline_source = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource, + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.Builder, + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSourceOrBuilder> + getInlineSourceFieldBuilder() { + if (inlineSourceBuilder_ == null) { + if (!(sourceCase_ == 2)) { + source_ = + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + .getDefaultInstance(); + } + inlineSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource, + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + .Builder, + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + .InlineSourceOrBuilder>( + (com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource) + source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 2; + onChanged(); + return inlineSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.GcsSource, + com.google.cloud.discoveryengine.v1alpha.GcsSource.Builder, + com.google.cloud.discoveryengine.v1alpha.GcsSourceOrBuilder> + gcsSourceBuilder_; + /** + * + * + *
+     * Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return sourceCase_ == 3; + } + /** + * + * + *
+     * Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 3) { + return (com.google.cloud.discoveryengine.v1alpha.GcsSource) source_; + } + return com.google.cloud.discoveryengine.v1alpha.GcsSource.getDefaultInstance(); + } else { + if (sourceCase_ == 3) { + return gcsSourceBuilder_.getMessage(); + } + return com.google.cloud.discoveryengine.v1alpha.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + */ + public Builder setGcsSource(com.google.cloud.discoveryengine.v1alpha.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + gcsSourceBuilder_.setMessage(value); + } + sourceCase_ = 3; + return this; + } + /** + * + * + *
+     * Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + */ + public Builder setGcsSource( + com.google.cloud.discoveryengine.v1alpha.GcsSource.Builder builderForValue) { + if (gcsSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + gcsSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 3; + return this; + } + /** + * + * + *
+     * Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + */ + public Builder mergeGcsSource(com.google.cloud.discoveryengine.v1alpha.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 3 + && source_ != com.google.cloud.discoveryengine.v1alpha.GcsSource.getDefaultInstance()) { + source_ = + com.google.cloud.discoveryengine.v1alpha.GcsSource.newBuilder( + (com.google.cloud.discoveryengine.v1alpha.GcsSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 3) { + gcsSourceBuilder_.mergeFrom(value); + } else { + gcsSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 3; + return this; + } + /** + * + * + *
+     * Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + */ + public Builder clearGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 3) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 3) { + sourceCase_ = 0; + source_ = null; + } + gcsSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + */ + public com.google.cloud.discoveryengine.v1alpha.GcsSource.Builder getGcsSourceBuilder() { + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if ((sourceCase_ == 3) && (gcsSourceBuilder_ != null)) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 3) { + return (com.google.cloud.discoveryengine.v1alpha.GcsSource) source_; + } + return com.google.cloud.discoveryengine.v1alpha.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.GcsSource, + com.google.cloud.discoveryengine.v1alpha.GcsSource.Builder, + com.google.cloud.discoveryengine.v1alpha.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + if (!(sourceCase_ == 3)) { + source_ = com.google.cloud.discoveryengine.v1alpha.GcsSource.getDefaultInstance(); + } + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.GcsSource, + com.google.cloud.discoveryengine.v1alpha.GcsSource.Builder, + com.google.cloud.discoveryengine.v1alpha.GcsSourceOrBuilder>( + (com.google.cloud.discoveryengine.v1alpha.GcsSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 3; + onChanged(); + return gcsSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.BigQuerySource, + com.google.cloud.discoveryengine.v1alpha.BigQuerySource.Builder, + com.google.cloud.discoveryengine.v1alpha.BigQuerySourceOrBuilder> + bigquerySourceBuilder_; + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + * + * @return Whether the bigquerySource field is set. + */ + @java.lang.Override + public boolean hasBigquerySource() { + return sourceCase_ == 4; + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + * + * @return The bigquerySource. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.BigQuerySource getBigquerySource() { + if (bigquerySourceBuilder_ == null) { + if (sourceCase_ == 4) { + return (com.google.cloud.discoveryengine.v1alpha.BigQuerySource) source_; + } + return com.google.cloud.discoveryengine.v1alpha.BigQuerySource.getDefaultInstance(); + } else { + if (sourceCase_ == 4) { + return bigquerySourceBuilder_.getMessage(); + } + return com.google.cloud.discoveryengine.v1alpha.BigQuerySource.getDefaultInstance(); + } + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + */ + public Builder setBigquerySource( + com.google.cloud.discoveryengine.v1alpha.BigQuerySource value) { + if (bigquerySourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + bigquerySourceBuilder_.setMessage(value); + } + sourceCase_ = 4; + return this; + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + */ + public Builder setBigquerySource( + com.google.cloud.discoveryengine.v1alpha.BigQuerySource.Builder builderForValue) { + if (bigquerySourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + bigquerySourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 4; + return this; + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + */ + public Builder mergeBigquerySource( + com.google.cloud.discoveryengine.v1alpha.BigQuerySource value) { + if (bigquerySourceBuilder_ == null) { + if (sourceCase_ == 4 + && source_ + != com.google.cloud.discoveryengine.v1alpha.BigQuerySource.getDefaultInstance()) { + source_ = + com.google.cloud.discoveryengine.v1alpha.BigQuerySource.newBuilder( + (com.google.cloud.discoveryengine.v1alpha.BigQuerySource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 4) { + bigquerySourceBuilder_.mergeFrom(value); + } else { + bigquerySourceBuilder_.setMessage(value); + } + } + sourceCase_ = 4; + return this; + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + */ + public Builder clearBigquerySource() { + if (bigquerySourceBuilder_ == null) { + if (sourceCase_ == 4) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 4) { + sourceCase_ = 0; + source_ = null; + } + bigquerySourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + */ + public com.google.cloud.discoveryengine.v1alpha.BigQuerySource.Builder + getBigquerySourceBuilder() { + return getBigquerySourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.BigQuerySourceOrBuilder + getBigquerySourceOrBuilder() { + if ((sourceCase_ == 4) && (bigquerySourceBuilder_ != null)) { + return bigquerySourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 4) { + return (com.google.cloud.discoveryengine.v1alpha.BigQuerySource) source_; + } + return com.google.cloud.discoveryengine.v1alpha.BigQuerySource.getDefaultInstance(); + } + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.BigQuerySource, + com.google.cloud.discoveryengine.v1alpha.BigQuerySource.Builder, + com.google.cloud.discoveryengine.v1alpha.BigQuerySourceOrBuilder> + getBigquerySourceFieldBuilder() { + if (bigquerySourceBuilder_ == null) { + if (!(sourceCase_ == 4)) { + source_ = com.google.cloud.discoveryengine.v1alpha.BigQuerySource.getDefaultInstance(); + } + bigquerySourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.BigQuerySource, + com.google.cloud.discoveryengine.v1alpha.BigQuerySource.Builder, + com.google.cloud.discoveryengine.v1alpha.BigQuerySourceOrBuilder>( + (com.google.cloud.discoveryengine.v1alpha.BigQuerySource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 4; + onChanged(); + return bigquerySourceBuilder_; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent branch resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+     * Requires create/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. The parent branch resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+     * Requires create/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. The parent branch resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+     * Requires create/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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent branch resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+     * Requires create/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(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent branch resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+     * Requires create/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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig errorConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.Builder, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder> + errorConfigBuilder_; + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + * + * @return Whether the errorConfig field is set. + */ + public boolean hasErrorConfig() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + * + * @return The errorConfig. + */ + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig getErrorConfig() { + if (errorConfigBuilder_ == null) { + return errorConfig_ == null + ? com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.getDefaultInstance() + : errorConfig_; + } else { + return errorConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + */ + public Builder setErrorConfig( + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig value) { + if (errorConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorConfig_ = value; + } else { + errorConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + */ + public Builder setErrorConfig( + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.Builder builderForValue) { + if (errorConfigBuilder_ == null) { + errorConfig_ = builderForValue.build(); + } else { + errorConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + */ + public Builder mergeErrorConfig( + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig value) { + if (errorConfigBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && errorConfig_ != null + && errorConfig_ + != com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig + .getDefaultInstance()) { + getErrorConfigBuilder().mergeFrom(value); + } else { + errorConfig_ = value; + } + } else { + errorConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + */ + public Builder clearErrorConfig() { + bitField0_ = (bitField0_ & ~0x00000010); + errorConfig_ = null; + if (errorConfigBuilder_ != null) { + errorConfigBuilder_.dispose(); + errorConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + */ + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.Builder + getErrorConfigBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getErrorConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + */ + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder + getErrorConfigOrBuilder() { + if (errorConfigBuilder_ != null) { + return errorConfigBuilder_.getMessageOrBuilder(); + } else { + return errorConfig_ == null + ? com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.getDefaultInstance() + : errorConfig_; + } + } + /** + * + * + *
+     * The desired location of errors incurred during the Import.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.Builder, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder> + getErrorConfigFieldBuilder() { + if (errorConfigBuilder_ == null) { + errorConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.Builder, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder>( + getErrorConfig(), getParentForChildren(), isClean()); + errorConfig_ = null; + } + return errorConfigBuilder_; + } + + private int reconciliationMode_ = 0; + /** + * + * + *
+     * The mode of reconciliation between existing documents and the documents to
+     * be imported. Defaults to
+     * [ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL].
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode reconciliation_mode = 6; + * + * + * @return The enum numeric value on the wire for reconciliationMode. + */ + @java.lang.Override + public int getReconciliationModeValue() { + return reconciliationMode_; + } + /** + * + * + *
+     * The mode of reconciliation between existing documents and the documents to
+     * be imported. Defaults to
+     * [ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL].
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode reconciliation_mode = 6; + * + * + * @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; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The mode of reconciliation between existing documents and the documents to
+     * be imported. Defaults to
+     * [ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL].
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode reconciliation_mode = 6; + * + * + * @return The reconciliationMode. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode + getReconciliationMode() { + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode result = + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode + .forNumber(reconciliationMode_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode + .UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The mode of reconciliation between existing documents and the documents to
+     * be imported. Defaults to
+     * [ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL].
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode reconciliation_mode = 6; + * + * + * @param value The reconciliationMode to set. + * @return This builder for chaining. + */ + public Builder setReconciliationMode( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + reconciliationMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The mode of reconciliation between existing documents and the documents to
+     * be imported. Defaults to
+     * [ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL].
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode reconciliation_mode = 6; + * + * + * @return This builder for chaining. + */ + public Builder clearReconciliationMode() { + bitField0_ = (bitField0_ & ~0x00000020); + reconciliationMode_ = 0; + onChanged(); + return this; + } + + private boolean autoGenerateIds_; + /** + * + * + *
+     * Whether to automatically generate IDs for the documents if absent.
+     *
+     * If set to `true`,
+     * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s are
+     * automatically generated based on the hash of the payload, where IDs may not
+     * be consistent during multiple imports. In which case
+     * [ReconciliationMode.FULL][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode.FULL]
+     * is highly recommended to avoid duplicate contents. If unset or set to
+     * `false`, [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s
+     * have to be specified using
+     * [id_field][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.id_field],
+     * otherwise, documents without IDs fail to be imported.
+     *
+     * Only set this field when using
+     * [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] or
+     * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource], and
+     * when
+     * [GcsSource.data_schema][google.cloud.discoveryengine.v1alpha.GcsSource.data_schema]
+     * or
+     * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema]
+     * is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
+     * 
+ * + * bool auto_generate_ids = 8; + * + * @return The autoGenerateIds. + */ + @java.lang.Override + public boolean getAutoGenerateIds() { + return autoGenerateIds_; + } + /** + * + * + *
+     * Whether to automatically generate IDs for the documents if absent.
+     *
+     * If set to `true`,
+     * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s are
+     * automatically generated based on the hash of the payload, where IDs may not
+     * be consistent during multiple imports. In which case
+     * [ReconciliationMode.FULL][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode.FULL]
+     * is highly recommended to avoid duplicate contents. If unset or set to
+     * `false`, [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s
+     * have to be specified using
+     * [id_field][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.id_field],
+     * otherwise, documents without IDs fail to be imported.
+     *
+     * Only set this field when using
+     * [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] or
+     * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource], and
+     * when
+     * [GcsSource.data_schema][google.cloud.discoveryengine.v1alpha.GcsSource.data_schema]
+     * or
+     * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema]
+     * is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
+     * 
+ * + * bool auto_generate_ids = 8; + * + * @param value The autoGenerateIds to set. + * @return This builder for chaining. + */ + public Builder setAutoGenerateIds(boolean value) { + + autoGenerateIds_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether to automatically generate IDs for the documents if absent.
+     *
+     * If set to `true`,
+     * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s are
+     * automatically generated based on the hash of the payload, where IDs may not
+     * be consistent during multiple imports. In which case
+     * [ReconciliationMode.FULL][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode.FULL]
+     * is highly recommended to avoid duplicate contents. If unset or set to
+     * `false`, [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s
+     * have to be specified using
+     * [id_field][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.id_field],
+     * otherwise, documents without IDs fail to be imported.
+     *
+     * Only set this field when using
+     * [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] or
+     * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource], and
+     * when
+     * [GcsSource.data_schema][google.cloud.discoveryengine.v1alpha.GcsSource.data_schema]
+     * or
+     * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema]
+     * is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
+     * 
+ * + * bool auto_generate_ids = 8; + * + * @return This builder for chaining. + */ + public Builder clearAutoGenerateIds() { + bitField0_ = (bitField0_ & ~0x00000040); + autoGenerateIds_ = false; + onChanged(); + return this; + } + + private java.lang.Object idField_ = ""; + /** + * + * + *
+     * The field in the Cloud Storage and BigQuery sources that indicates the
+     * unique IDs of the documents.
+     *
+     * For [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] it is the
+     * key of the JSON field. For instance, `my_id` for JSON `{"my_id":
+     * "some_uuid"}`. For
+     * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource] it is
+     * the column name of the BigQuery table where the unique ids are stored.
+     *
+     * The values of the JSON field or the BigQuery column are used as the
+     * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s. The JSON
+     * field or the BigQuery column must be of string type, and the values must be
+     * set as valid strings conform to
+     * [RFC-1034](https://tools.ietf.org/html/rfc1034) with 1-63 characters.
+     * Otherwise, documents without valid IDs fail to be imported.
+     *
+     * Only set this field when using
+     * [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] or
+     * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource], and
+     * when
+     * [GcsSource.data_schema][google.cloud.discoveryengine.v1alpha.GcsSource.data_schema]
+     * or
+     * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema]
+     * is `custom`. And only set this field when
+     * [auto_generate_ids][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.auto_generate_ids]
+     * is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown.
+     *
+     * If it is unset, a default value `_id` is used when importing from the
+     * allowed data sources.
+     * 
+ * + * string id_field = 9; + * + * @return The idField. + */ + public java.lang.String getIdField() { + java.lang.Object ref = idField_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + idField_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The field in the Cloud Storage and BigQuery sources that indicates the
+     * unique IDs of the documents.
+     *
+     * For [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] it is the
+     * key of the JSON field. For instance, `my_id` for JSON `{"my_id":
+     * "some_uuid"}`. For
+     * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource] it is
+     * the column name of the BigQuery table where the unique ids are stored.
+     *
+     * The values of the JSON field or the BigQuery column are used as the
+     * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s. The JSON
+     * field or the BigQuery column must be of string type, and the values must be
+     * set as valid strings conform to
+     * [RFC-1034](https://tools.ietf.org/html/rfc1034) with 1-63 characters.
+     * Otherwise, documents without valid IDs fail to be imported.
+     *
+     * Only set this field when using
+     * [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] or
+     * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource], and
+     * when
+     * [GcsSource.data_schema][google.cloud.discoveryengine.v1alpha.GcsSource.data_schema]
+     * or
+     * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema]
+     * is `custom`. And only set this field when
+     * [auto_generate_ids][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.auto_generate_ids]
+     * is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown.
+     *
+     * If it is unset, a default value `_id` is used when importing from the
+     * allowed data sources.
+     * 
+ * + * string id_field = 9; + * + * @return The bytes for idField. + */ + public com.google.protobuf.ByteString getIdFieldBytes() { + java.lang.Object ref = idField_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + idField_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The field in the Cloud Storage and BigQuery sources that indicates the
+     * unique IDs of the documents.
+     *
+     * For [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] it is the
+     * key of the JSON field. For instance, `my_id` for JSON `{"my_id":
+     * "some_uuid"}`. For
+     * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource] it is
+     * the column name of the BigQuery table where the unique ids are stored.
+     *
+     * The values of the JSON field or the BigQuery column are used as the
+     * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s. The JSON
+     * field or the BigQuery column must be of string type, and the values must be
+     * set as valid strings conform to
+     * [RFC-1034](https://tools.ietf.org/html/rfc1034) with 1-63 characters.
+     * Otherwise, documents without valid IDs fail to be imported.
+     *
+     * Only set this field when using
+     * [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] or
+     * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource], and
+     * when
+     * [GcsSource.data_schema][google.cloud.discoveryengine.v1alpha.GcsSource.data_schema]
+     * or
+     * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema]
+     * is `custom`. And only set this field when
+     * [auto_generate_ids][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.auto_generate_ids]
+     * is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown.
+     *
+     * If it is unset, a default value `_id` is used when importing from the
+     * allowed data sources.
+     * 
+ * + * string id_field = 9; + * + * @param value The idField to set. + * @return This builder for chaining. + */ + public Builder setIdField(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + idField_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * The field in the Cloud Storage and BigQuery sources that indicates the
+     * unique IDs of the documents.
+     *
+     * For [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] it is the
+     * key of the JSON field. For instance, `my_id` for JSON `{"my_id":
+     * "some_uuid"}`. For
+     * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource] it is
+     * the column name of the BigQuery table where the unique ids are stored.
+     *
+     * The values of the JSON field or the BigQuery column are used as the
+     * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s. The JSON
+     * field or the BigQuery column must be of string type, and the values must be
+     * set as valid strings conform to
+     * [RFC-1034](https://tools.ietf.org/html/rfc1034) with 1-63 characters.
+     * Otherwise, documents without valid IDs fail to be imported.
+     *
+     * Only set this field when using
+     * [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] or
+     * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource], and
+     * when
+     * [GcsSource.data_schema][google.cloud.discoveryengine.v1alpha.GcsSource.data_schema]
+     * or
+     * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema]
+     * is `custom`. And only set this field when
+     * [auto_generate_ids][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.auto_generate_ids]
+     * is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown.
+     *
+     * If it is unset, a default value `_id` is used when importing from the
+     * allowed data sources.
+     * 
+ * + * string id_field = 9; + * + * @return This builder for chaining. + */ + public Builder clearIdField() { + idField_ = getDefaultInstance().getIdField(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * The field in the Cloud Storage and BigQuery sources that indicates the
+     * unique IDs of the documents.
+     *
+     * For [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] it is the
+     * key of the JSON field. For instance, `my_id` for JSON `{"my_id":
+     * "some_uuid"}`. For
+     * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource] it is
+     * the column name of the BigQuery table where the unique ids are stored.
+     *
+     * The values of the JSON field or the BigQuery column are used as the
+     * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s. The JSON
+     * field or the BigQuery column must be of string type, and the values must be
+     * set as valid strings conform to
+     * [RFC-1034](https://tools.ietf.org/html/rfc1034) with 1-63 characters.
+     * Otherwise, documents without valid IDs fail to be imported.
+     *
+     * Only set this field when using
+     * [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] or
+     * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource], and
+     * when
+     * [GcsSource.data_schema][google.cloud.discoveryengine.v1alpha.GcsSource.data_schema]
+     * or
+     * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema]
+     * is `custom`. And only set this field when
+     * [auto_generate_ids][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.auto_generate_ids]
+     * is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown.
+     *
+     * If it is unset, a default value `_id` is used when importing from the
+     * allowed data sources.
+     * 
+ * + * string id_field = 9; + * + * @param value The bytes for idField to set. + * @return This builder for chaining. + */ + public Builder setIdFieldBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + idField_ = value; + bitField0_ |= 0x00000080; + 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.discoveryengine.v1alpha.ImportDocumentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest) + private static final com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportDocumentsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsRequestOrBuilder.java new file mode 100644 index 000000000000..88049e85bd0c --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsRequestOrBuilder.java @@ -0,0 +1,355 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/import_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface ImportDocumentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Inline source for the input content for documents.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource inline_source = 2; + * + * + * @return Whether the inlineSource field is set. + */ + boolean hasInlineSource(); + /** + * + * + *
+   * The Inline source for the input content for documents.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource inline_source = 2; + * + * + * @return The inlineSource. + */ + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource getInlineSource(); + /** + * + * + *
+   * The Inline source for the input content for documents.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource inline_source = 2; + * + */ + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSourceOrBuilder + getInlineSourceOrBuilder(); + + /** + * + * + *
+   * Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + * + * @return Whether the gcsSource field is set. + */ + boolean hasGcsSource(); + /** + * + * + *
+   * Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + * + * @return The gcsSource. + */ + com.google.cloud.discoveryengine.v1alpha.GcsSource getGcsSource(); + /** + * + * + *
+   * Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + */ + com.google.cloud.discoveryengine.v1alpha.GcsSourceOrBuilder getGcsSourceOrBuilder(); + + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + * + * @return Whether the bigquerySource field is set. + */ + boolean hasBigquerySource(); + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + * + * @return The bigquerySource. + */ + com.google.cloud.discoveryengine.v1alpha.BigQuerySource getBigquerySource(); + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + */ + com.google.cloud.discoveryengine.v1alpha.BigQuerySourceOrBuilder getBigquerySourceOrBuilder(); + + /** + * + * + *
+   * Required. The parent branch resource name, such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+   * Requires create/update permission.
+   * 
+ * + * + * 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/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+   * Requires create/update permission.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The desired location of errors incurred during the Import.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + * + * @return Whether the errorConfig field is set. + */ + boolean hasErrorConfig(); + /** + * + * + *
+   * The desired location of errors incurred during the Import.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + * + * @return The errorConfig. + */ + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig getErrorConfig(); + /** + * + * + *
+   * The desired location of errors incurred during the Import.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + */ + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder getErrorConfigOrBuilder(); + + /** + * + * + *
+   * The mode of reconciliation between existing documents and the documents to
+   * be imported. Defaults to
+   * [ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL].
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode reconciliation_mode = 6; + * + * + * @return The enum numeric value on the wire for reconciliationMode. + */ + int getReconciliationModeValue(); + /** + * + * + *
+   * The mode of reconciliation between existing documents and the documents to
+   * be imported. Defaults to
+   * [ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL].
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode reconciliation_mode = 6; + * + * + * @return The reconciliationMode. + */ + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode + getReconciliationMode(); + + /** + * + * + *
+   * Whether to automatically generate IDs for the documents if absent.
+   *
+   * If set to `true`,
+   * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s are
+   * automatically generated based on the hash of the payload, where IDs may not
+   * be consistent during multiple imports. In which case
+   * [ReconciliationMode.FULL][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode.FULL]
+   * is highly recommended to avoid duplicate contents. If unset or set to
+   * `false`, [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s
+   * have to be specified using
+   * [id_field][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.id_field],
+   * otherwise, documents without IDs fail to be imported.
+   *
+   * Only set this field when using
+   * [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] or
+   * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource], and
+   * when
+   * [GcsSource.data_schema][google.cloud.discoveryengine.v1alpha.GcsSource.data_schema]
+   * or
+   * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema]
+   * is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
+   * 
+ * + * bool auto_generate_ids = 8; + * + * @return The autoGenerateIds. + */ + boolean getAutoGenerateIds(); + + /** + * + * + *
+   * The field in the Cloud Storage and BigQuery sources that indicates the
+   * unique IDs of the documents.
+   *
+   * For [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] it is the
+   * key of the JSON field. For instance, `my_id` for JSON `{"my_id":
+   * "some_uuid"}`. For
+   * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource] it is
+   * the column name of the BigQuery table where the unique ids are stored.
+   *
+   * The values of the JSON field or the BigQuery column are used as the
+   * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s. The JSON
+   * field or the BigQuery column must be of string type, and the values must be
+   * set as valid strings conform to
+   * [RFC-1034](https://tools.ietf.org/html/rfc1034) with 1-63 characters.
+   * Otherwise, documents without valid IDs fail to be imported.
+   *
+   * Only set this field when using
+   * [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] or
+   * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource], and
+   * when
+   * [GcsSource.data_schema][google.cloud.discoveryengine.v1alpha.GcsSource.data_schema]
+   * or
+   * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema]
+   * is `custom`. And only set this field when
+   * [auto_generate_ids][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.auto_generate_ids]
+   * is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown.
+   *
+   * If it is unset, a default value `_id` is used when importing from the
+   * allowed data sources.
+   * 
+ * + * string id_field = 9; + * + * @return The idField. + */ + java.lang.String getIdField(); + /** + * + * + *
+   * The field in the Cloud Storage and BigQuery sources that indicates the
+   * unique IDs of the documents.
+   *
+   * For [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] it is the
+   * key of the JSON field. For instance, `my_id` for JSON `{"my_id":
+   * "some_uuid"}`. For
+   * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource] it is
+   * the column name of the BigQuery table where the unique ids are stored.
+   *
+   * The values of the JSON field or the BigQuery column are used as the
+   * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s. The JSON
+   * field or the BigQuery column must be of string type, and the values must be
+   * set as valid strings conform to
+   * [RFC-1034](https://tools.ietf.org/html/rfc1034) with 1-63 characters.
+   * Otherwise, documents without valid IDs fail to be imported.
+   *
+   * Only set this field when using
+   * [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] or
+   * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource], and
+   * when
+   * [GcsSource.data_schema][google.cloud.discoveryengine.v1alpha.GcsSource.data_schema]
+   * or
+   * [BigQuerySource.data_schema][google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema]
+   * is `custom`. And only set this field when
+   * [auto_generate_ids][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.auto_generate_ids]
+   * is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown.
+   *
+   * If it is unset, a default value `_id` is used when importing from the
+   * allowed data sources.
+   * 
+ * + * string id_field = 9; + * + * @return The bytes for idField. + */ + com.google.protobuf.ByteString getIdFieldBytes(); + + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.SourceCase getSourceCase(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsResponse.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsResponse.java new file mode 100644 index 000000000000..d5e7a39c9c31 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsResponse.java @@ -0,0 +1,1209 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/import_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Response of the
+ * [ImportDocumentsRequest][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest].
+ * 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.discoveryengine.v1alpha.ImportDocumentsResponse} + */ +public final class ImportDocumentsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse) + ImportDocumentsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportDocumentsResponse.newBuilder() to construct. + private ImportDocumentsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportDocumentsResponse() { + errorSamples_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportDocumentsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse.class, + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse.Builder.class); + } + + public static final int ERROR_SAMPLES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List errorSamples_; + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesOrBuilderList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public int getErrorSamplesCount() { + return errorSamples_.size(); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.Status getErrorSamples(int index) { + return errorSamples_.get(index); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + return errorSamples_.get(index); + } + + public static final int ERROR_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig errorConfig_; + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + * + * @return Whether the errorConfig field is set. + */ + @java.lang.Override + public boolean hasErrorConfig() { + return errorConfig_ != null; + } + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + * + * @return The errorConfig. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig getErrorConfig() { + return errorConfig_ == null + ? com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.getDefaultInstance() + : errorConfig_; + } + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder + getErrorConfigOrBuilder() { + return errorConfig_ == null + ? com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.getDefaultInstance() + : errorConfig_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (errorConfig_ != null) { + output.writeMessage(2, getErrorConfig()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < errorSamples_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, errorSamples_.get(i)); + } + if (errorConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getErrorConfig()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse other = + (com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse) obj; + + if (!getErrorSamplesList().equals(other.getErrorSamplesList())) return false; + if (hasErrorConfig() != other.hasErrorConfig()) return false; + if (hasErrorConfig()) { + if (!getErrorConfig().equals(other.getErrorConfig())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getErrorSamplesCount() > 0) { + hash = (37 * hash) + ERROR_SAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getErrorSamplesList().hashCode(); + } + if (hasErrorConfig()) { + hash = (37 * hash) + ERROR_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getErrorConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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
+   * [ImportDocumentsRequest][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest].
+   * 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.discoveryengine.v1alpha.ImportDocumentsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse) + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse.class, + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + } else { + errorSamples_ = null; + errorSamplesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + errorConfig_ = null; + if (errorConfigBuilder_ != null) { + errorConfigBuilder_.dispose(); + errorConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportDocumentsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse build() { + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse buildPartial() { + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse result = + new com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse result) { + if (errorSamplesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.errorSamples_ = errorSamples_; + } else { + result.errorSamples_ = errorSamplesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.errorConfig_ = + errorConfigBuilder_ == null ? errorConfig_ : errorConfigBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse.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.hasErrorConfig()) { + mergeErrorConfig(other.getErrorConfig()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.rpc.Status m = + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(m); + } else { + errorSamplesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + input.readMessage(getErrorConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int 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.discoveryengine.v1alpha.ImportErrorConfig errorConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.Builder, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder> + errorConfigBuilder_; + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + * + * @return Whether the errorConfig field is set. + */ + public boolean hasErrorConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + * + * @return The errorConfig. + */ + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig getErrorConfig() { + if (errorConfigBuilder_ == null) { + return errorConfig_ == null + ? com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.getDefaultInstance() + : errorConfig_; + } else { + return errorConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + */ + public Builder setErrorConfig( + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig value) { + if (errorConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorConfig_ = value; + } else { + errorConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + */ + public Builder setErrorConfig( + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.Builder builderForValue) { + if (errorConfigBuilder_ == null) { + errorConfig_ = builderForValue.build(); + } else { + errorConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + */ + public Builder mergeErrorConfig( + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig value) { + if (errorConfigBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && errorConfig_ != null + && errorConfig_ + != com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig + .getDefaultInstance()) { + getErrorConfigBuilder().mergeFrom(value); + } else { + errorConfig_ = value; + } + } else { + errorConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + */ + public Builder clearErrorConfig() { + bitField0_ = (bitField0_ & ~0x00000002); + errorConfig_ = null; + if (errorConfigBuilder_ != null) { + errorConfigBuilder_.dispose(); + errorConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.Builder + getErrorConfigBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getErrorConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder + getErrorConfigOrBuilder() { + if (errorConfigBuilder_ != null) { + return errorConfigBuilder_.getMessageOrBuilder(); + } else { + return errorConfig_ == null + ? com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.getDefaultInstance() + : errorConfig_; + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors in the request if set.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.Builder, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder> + getErrorConfigFieldBuilder() { + if (errorConfigBuilder_ == null) { + errorConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.Builder, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder>( + getErrorConfig(), getParentForChildren(), isClean()); + errorConfig_ = null; + } + return errorConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse) + private static final com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse(); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportDocumentsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsResponseOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsResponseOrBuilder.java new file mode 100644 index 000000000000..ab025a72d265 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportDocumentsResponseOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/import_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface ImportDocumentsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse) + 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.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + * + * @return Whether the errorConfig field is set. + */ + boolean hasErrorConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + * + * @return The errorConfig. + */ + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig getErrorConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors in the request if set.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + */ + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder getErrorConfigOrBuilder(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportErrorConfig.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportErrorConfig.java new file mode 100644 index 000000000000..0761429b8438 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportErrorConfig.java @@ -0,0 +1,784 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/import_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Configuration of destination for Import related errors.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ImportErrorConfig} + */ +public final class ImportErrorConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.ImportErrorConfig) + ImportErrorConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportErrorConfig.newBuilder() to construct. + private ImportErrorConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportErrorConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportErrorConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportErrorConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportErrorConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.class, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.Builder.class); + } + + private int destinationCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object destination_; + + public enum DestinationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GCS_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; + /** + * + * + *
+   * Cloud Storage prefix for import errors. This must be an empty,
+   * existing Cloud Storage directory. Import errors are written to
+   * sharded files in this directory, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return Whether the gcsPrefix field is set. + */ + public boolean hasGcsPrefix() { + return destinationCase_ == 1; + } + /** + * + * + *
+   * Cloud Storage prefix for import errors. This must be an empty,
+   * existing Cloud Storage directory. Import errors are written to
+   * sharded files in this directory, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @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; + } + } + /** + * + * + *
+   * Cloud Storage prefix for import errors. This must be an empty,
+   * existing Cloud Storage directory. Import errors are written to
+   * sharded files in this directory, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @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_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (destinationCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, destination_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig other = + (com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig) obj; + + if (!getDestinationCase().equals(other.getDestinationCase())) return false; + switch (destinationCase_) { + case 1: + if (!getGcsPrefix().equals(other.getGcsPrefix())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (destinationCase_) { + case 1: + hash = (37 * hash) + GCS_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getGcsPrefix().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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.discoveryengine.v1alpha.ImportErrorConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.ImportErrorConfig) + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportErrorConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportErrorConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.class, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + destinationCase_ = 0; + destination_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportErrorConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig build() { + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig buildPartial() { + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig result = + new com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs( + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig result) { + result.destinationCase_ = destinationCase_; + result.destination_ = this.destination_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig other) { + if (other == com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.getDefaultInstance()) + return this; + switch (other.getDestinationCase()) { + case GCS_PREFIX: + { + destinationCase_ = 1; + destination_ = other.destination_; + onChanged(); + break; + } + case DESTINATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + destinationCase_ = 1; + destination_ = s; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public Builder clearDestination() { + destinationCase_ = 0; + destination_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+     * Cloud Storage prefix for import errors. This must be an empty,
+     * existing Cloud Storage directory. Import errors are written to
+     * sharded files in this directory, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @return Whether the gcsPrefix field is set. + */ + @java.lang.Override + public boolean hasGcsPrefix() { + return destinationCase_ == 1; + } + /** + * + * + *
+     * Cloud Storage prefix for import errors. This must be an empty,
+     * existing Cloud Storage directory. Import errors are written to
+     * sharded files in this directory, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @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; + } + } + /** + * + * + *
+     * Cloud Storage prefix for import errors. This must be an empty,
+     * existing Cloud Storage directory. Import errors are written to
+     * sharded files in this directory, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @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; + } + } + /** + * + * + *
+     * Cloud Storage prefix for import errors. This must be an empty,
+     * existing Cloud Storage directory. Import errors are written to
+     * sharded files in this directory, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @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; + } + /** + * + * + *
+     * Cloud Storage prefix for import errors. This must be an empty,
+     * existing Cloud Storage directory. Import errors are written to
+     * sharded files in this directory, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @return This builder for chaining. + */ + public Builder clearGcsPrefix() { + if (destinationCase_ == 1) { + destinationCase_ = 0; + destination_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Cloud Storage prefix for import errors. This must be an empty,
+     * existing Cloud Storage directory. Import errors are written to
+     * sharded files in this directory, one per line, as a JSON-encoded
+     * `google.rpc.Status` message.
+     * 
+ * + * string gcs_prefix = 1; + * + * @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.discoveryengine.v1alpha.ImportErrorConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.ImportErrorConfig) + private static final com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig(); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportErrorConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportErrorConfigOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportErrorConfigOrBuilder.java new file mode 100644 index 000000000000..ff0bf81d0060 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportErrorConfigOrBuilder.java @@ -0,0 +1,73 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/import_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface ImportErrorConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.ImportErrorConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud Storage prefix for import errors. This must be an empty,
+   * existing Cloud Storage directory. Import errors are written to
+   * sharded files in this directory, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return Whether the gcsPrefix field is set. + */ + boolean hasGcsPrefix(); + /** + * + * + *
+   * Cloud Storage prefix for import errors. This must be an empty,
+   * existing Cloud Storage directory. Import errors are written to
+   * sharded files in this directory, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return The gcsPrefix. + */ + java.lang.String getGcsPrefix(); + /** + * + * + *
+   * Cloud Storage prefix for import errors. This must be an empty,
+   * existing Cloud Storage directory. Import errors are written to
+   * sharded files in this directory, one per line, as a JSON-encoded
+   * `google.rpc.Status` message.
+   * 
+ * + * string gcs_prefix = 1; + * + * @return The bytes for gcsPrefix. + */ + com.google.protobuf.ByteString getGcsPrefixBytes(); + + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.DestinationCase getDestinationCase(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsMetadata.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsMetadata.java new file mode 100644 index 000000000000..43fb807a972f --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsMetadata.java @@ -0,0 +1,1171 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/import_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Metadata related to the progress of the Import operation. This is
+ * returned by the google.longrunning.Operation.metadata field.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata} + */ +public final class ImportUserEventsMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata) + ImportUserEventsMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportUserEventsMetadata.newBuilder() to construct. + private ImportUserEventsMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportUserEventsMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportUserEventsMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata.class, + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata.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 createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + 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 updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int SUCCESS_COUNT_FIELD_NUMBER = 3; + private long successCount_ = 0L; + /** + * + * + *
+   * 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_ = 0L; + /** + * + * + *
+   * 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_); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata other = + (com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata) 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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 is
+   * returned by the google.longrunning.Operation.metadata field.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata) + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata.class, + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + successCount_ = 0L; + failureCount_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata build() { + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata buildPartial() { + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata result = + new com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.successCount_ = successCount_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.failureCount_ = failureCount_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata.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.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + successCount_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + failureCount_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private 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 ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * 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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + 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(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000001); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000001; + 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 ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * 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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + 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(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + 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 (((bitField0_ & 0x00000002) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + 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() { + bitField0_ = (bitField0_ & ~0x00000002); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + 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() { + bitField0_ |= 0x00000002; + 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of entries that were processed successfully.
+     * 
+ * + * int64 success_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearSuccessCount() { + bitField0_ = (bitField0_ & ~0x00000004); + 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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of entries that encountered errors while processing.
+     * 
+ * + * int64 failure_count = 4; + * + * @return This builder for chaining. + */ + public Builder clearFailureCount() { + bitField0_ = (bitField0_ & ~0x00000008); + 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.discoveryengine.v1alpha.ImportUserEventsMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata) + private static final com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata(); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportUserEventsMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsMetadataOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsMetadataOrBuilder.java new file mode 100644 index 000000000000..60e6b1bdbc16 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsMetadataOrBuilder.java @@ -0,0 +1,124 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/import_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface ImportUserEventsMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata) + 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(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsRequest.java new file mode 100644 index 000000000000..9b1076884f27 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsRequest.java @@ -0,0 +1,3041 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/import_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request message for the ImportUserEvents request.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest} + */ +public final class ImportUserEventsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.class, + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.Builder.class); + } + + public interface InlineSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.discoveryengine.v1alpha.UserEvent getUserEvents(int index); + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.discoveryengine.v1alpha.UserEventOrBuilder getUserEventsOrBuilder(int index); + } + /** + * + * + *
+   * The inline source for the input config for ImportUserEvents method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource} + */ + public static final class InlineSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource) + InlineSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use InlineSource.newBuilder() to construct. + private InlineSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InlineSource() { + userEvents_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InlineSource(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsRequest_InlineSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsRequest_InlineSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.class, + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.Builder + .class); + } + + public static final int USER_EVENTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List userEvents_; + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UserEvent getUserEvents(int index) { + return userEvents_.get(index); + } + /** + * + * + *
+     * Required. A list of user events to import. Recommended max of 10k items.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.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)); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource other = + (com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource) obj; + + if (!getUserEventsList().equals(other.getUserEventsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getUserEventsCount() > 0) { + hash = (37 * hash) + USER_EVENTS_FIELD_NUMBER; + hash = (53 * hash) + getUserEventsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource) + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsRequest_InlineSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsRequest_InlineSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.class, + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + .Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (userEventsBuilder_ == null) { + userEvents_ = java.util.Collections.emptyList(); + } else { + userEvents_ = null; + userEventsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsRequest_InlineSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource build() { + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + buildPartial() { + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource result = + new com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource result) { + if (userEventsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + userEvents_ = java.util.Collections.unmodifiableList(userEvents_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.userEvents_ = userEvents_; + } else { + result.userEvents_ = userEventsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + .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.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.discoveryengine.v1alpha.UserEvent m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.UserEvent.parser(), + extensionRegistry); + if (userEventsBuilder_ == null) { + ensureUserEventsIsMutable(); + userEvents_.add(m); + } else { + userEventsBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.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.discoveryengine.v1alpha.UserEvent, + com.google.cloud.discoveryengine.v1alpha.UserEvent.Builder, + com.google.cloud.discoveryengine.v1alpha.UserEventOrBuilder> + userEventsBuilder_; + + /** + * + * + *
+       * Required. A list of user events to import. Recommended max of 10k items.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEvents( + int index, com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEvents( + int index, com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addUserEvents(com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addUserEvents( + int index, com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addUserEvents( + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addUserEvents( + int index, com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.UserEvent.Builder addUserEventsBuilder() { + return getUserEventsFieldBuilder() + .addBuilder(com.google.cloud.discoveryengine.v1alpha.UserEvent.getDefaultInstance()); + } + /** + * + * + *
+       * Required. A list of user events to import. Recommended max of 10k items.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.UserEvent user_events = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.UserEvent.Builder addUserEventsBuilder( + int index) { + return getUserEventsFieldBuilder() + .addBuilder( + index, com.google.cloud.discoveryengine.v1alpha.UserEvent.getDefaultInstance()); + } + /** + * + * + *
+       * Required. A list of user events to import. Recommended max of 10k items.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEvent, + com.google.cloud.discoveryengine.v1alpha.UserEvent.Builder, + com.google.cloud.discoveryengine.v1alpha.UserEventOrBuilder> + getUserEventsFieldBuilder() { + if (userEventsBuilder_ == null) { + userEventsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.UserEvent, + com.google.cloud.discoveryengine.v1alpha.UserEvent.Builder, + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource) + private static final com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest + .InlineSource + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource(); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InlineSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int sourceCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + INLINE_SOURCE(2), + GCS_SOURCE(3), + BIGQUERY_SOURCE(4), + 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 2: + return INLINE_SOURCE; + case 3: + return GCS_SOURCE; + case 4: + return BIGQUERY_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 INLINE_SOURCE_FIELD_NUMBER = 2; + /** + * + * + *
+   * The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource inline_source = 2; + * + * + * @return Whether the inlineSource field is set. + */ + @java.lang.Override + public boolean hasInlineSource() { + return sourceCase_ == 2; + } + /** + * + * + *
+   * The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource inline_source = 2; + * + * + * @return The inlineSource. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + getInlineSource() { + if (sourceCase_ == 2) { + return (com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource) + source_; + } + return com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + .getDefaultInstance(); + } + /** + * + * + *
+   * The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource inline_source = 2; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSourceOrBuilder + getInlineSourceOrBuilder() { + if (sourceCase_ == 2) { + return (com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource) + source_; + } + return com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + .getDefaultInstance(); + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 3; + /** + * + * + *
+   * Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return sourceCase_ == 3; + } + /** + * + * + *
+   * Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GcsSource getGcsSource() { + if (sourceCase_ == 3) { + return (com.google.cloud.discoveryengine.v1alpha.GcsSource) source_; + } + return com.google.cloud.discoveryengine.v1alpha.GcsSource.getDefaultInstance(); + } + /** + * + * + *
+   * Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (sourceCase_ == 3) { + return (com.google.cloud.discoveryengine.v1alpha.GcsSource) source_; + } + return com.google.cloud.discoveryengine.v1alpha.GcsSource.getDefaultInstance(); + } + + public static final int BIGQUERY_SOURCE_FIELD_NUMBER = 4; + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + * + * @return Whether the bigquerySource field is set. + */ + @java.lang.Override + public boolean hasBigquerySource() { + return sourceCase_ == 4; + } + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + * + * @return The bigquerySource. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.BigQuerySource getBigquerySource() { + if (sourceCase_ == 4) { + return (com.google.cloud.discoveryengine.v1alpha.BigQuerySource) source_; + } + return com.google.cloud.discoveryengine.v1alpha.BigQuerySource.getDefaultInstance(); + } + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.BigQuerySourceOrBuilder + getBigquerySourceOrBuilder() { + if (sourceCase_ == 4) { + return (com.google.cloud.discoveryengine.v1alpha.BigQuerySource) source_; + } + return com.google.cloud.discoveryengine.v1alpha.BigQuerySource.getDefaultInstance(); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent DataStore resource name, of the form
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`
+   * 
+ * + * + * 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. Parent DataStore resource name, of the form
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`
+   * 
+ * + * + * 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 ERROR_CONFIG_FIELD_NUMBER = 5; + private com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig errorConfig_; + /** + * + * + *
+   * The desired location of errors incurred during the Import. Cannot be set
+   * for inline user event imports.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + * + * @return Whether the errorConfig field is set. + */ + @java.lang.Override + public boolean hasErrorConfig() { + return errorConfig_ != null; + } + /** + * + * + *
+   * The desired location of errors incurred during the Import. Cannot be set
+   * for inline user event imports.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + * + * @return The errorConfig. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig getErrorConfig() { + return errorConfig_ == null + ? com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.getDefaultInstance() + : errorConfig_; + } + /** + * + * + *
+   * The desired location of errors incurred during the Import. Cannot be set
+   * for inline user event imports.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder + getErrorConfigOrBuilder() { + return errorConfig_ == null + ? com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.getDefaultInstance() + : errorConfig_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (sourceCase_ == 2) { + output.writeMessage( + 2, + (com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource) source_); + } + if (sourceCase_ == 3) { + output.writeMessage(3, (com.google.cloud.discoveryengine.v1alpha.GcsSource) source_); + } + if (sourceCase_ == 4) { + output.writeMessage(4, (com.google.cloud.discoveryengine.v1alpha.BigQuerySource) source_); + } + if (errorConfig_ != null) { + output.writeMessage(5, getErrorConfig()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (sourceCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, + (com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource) + source_); + } + if (sourceCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.discoveryengine.v1alpha.GcsSource) source_); + } + if (sourceCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.discoveryengine.v1alpha.BigQuerySource) source_); + } + if (errorConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getErrorConfig()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest other = + (com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasErrorConfig() != other.hasErrorConfig()) return false; + if (hasErrorConfig()) { + if (!getErrorConfig().equals(other.getErrorConfig())) return false; + } + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 2: + if (!getInlineSource().equals(other.getInlineSource())) return false; + break; + case 3: + if (!getGcsSource().equals(other.getGcsSource())) return false; + break; + case 4: + if (!getBigquerySource().equals(other.getBigquerySource())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasErrorConfig()) { + hash = (37 * hash) + ERROR_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getErrorConfig().hashCode(); + } + switch (sourceCase_) { + case 2: + hash = (37 * hash) + INLINE_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getInlineSource().hashCode(); + break; + case 3: + hash = (37 * hash) + GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getGcsSource().hashCode(); + break; + case 4: + hash = (37 * hash) + BIGQUERY_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getBigquerySource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.ImportUserEventsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.ImportUserEventsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.ImportUserEventsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.ImportUserEventsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.ImportUserEventsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest) + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.class, + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (inlineSourceBuilder_ != null) { + inlineSourceBuilder_.clear(); + } + if (gcsSourceBuilder_ != null) { + gcsSourceBuilder_.clear(); + } + if (bigquerySourceBuilder_ != null) { + bigquerySourceBuilder_.clear(); + } + parent_ = ""; + errorConfig_ = null; + if (errorConfigBuilder_ != null) { + errorConfigBuilder_.dispose(); + errorConfigBuilder_ = null; + } + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest build() { + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest result = + new com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.errorConfig_ = + errorConfigBuilder_ == null ? errorConfig_ : errorConfigBuilder_.build(); + } + } + + private void buildPartialOneofs( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest result) { + result.sourceCase_ = sourceCase_; + result.source_ = this.source_; + if (sourceCase_ == 2 && inlineSourceBuilder_ != null) { + result.source_ = inlineSourceBuilder_.build(); + } + if (sourceCase_ == 3 && gcsSourceBuilder_ != null) { + result.source_ = gcsSourceBuilder_.build(); + } + if (sourceCase_ == 4 && bigquerySourceBuilder_ != null) { + result.source_ = bigquerySourceBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasErrorConfig()) { + mergeErrorConfig(other.getErrorConfig()); + } + switch (other.getSourceCase()) { + case INLINE_SOURCE: + { + mergeInlineSource(other.getInlineSource()); + break; + } + case GCS_SOURCE: + { + mergeGcsSource(other.getGcsSource()); + break; + } + case BIGQUERY_SOURCE: + { + mergeBigquerySource(other.getBigquerySource()); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 10 + case 18: + { + input.readMessage(getInlineSourceFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getGcsSourceFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage(getBigquerySourceFieldBuilder().getBuilder(), extensionRegistry); + sourceCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage(getErrorConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int 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 int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource, + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.Builder, + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSourceOrBuilder> + inlineSourceBuilder_; + /** + * + * + *
+     * The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource inline_source = 2; + * + * + * @return Whether the inlineSource field is set. + */ + @java.lang.Override + public boolean hasInlineSource() { + return sourceCase_ == 2; + } + /** + * + * + *
+     * The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource inline_source = 2; + * + * + * @return The inlineSource. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + getInlineSource() { + if (inlineSourceBuilder_ == null) { + if (sourceCase_ == 2) { + return (com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource) + source_; + } + return com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + .getDefaultInstance(); + } else { + if (sourceCase_ == 2) { + return inlineSourceBuilder_.getMessage(); + } + return com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + .getDefaultInstance(); + } + } + /** + * + * + *
+     * The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource inline_source = 2; + * + */ + public Builder setInlineSource( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource value) { + if (inlineSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + inlineSourceBuilder_.setMessage(value); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource inline_source = 2; + * + */ + public Builder setInlineSource( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.Builder + builderForValue) { + if (inlineSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + inlineSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource inline_source = 2; + * + */ + public Builder mergeInlineSource( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource value) { + if (inlineSourceBuilder_ == null) { + if (sourceCase_ == 2 + && source_ + != com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + .getDefaultInstance()) { + source_ = + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + .newBuilder( + (com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest + .InlineSource) + source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 2) { + inlineSourceBuilder_.mergeFrom(value); + } else { + inlineSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource inline_source = 2; + * + */ + public Builder clearInlineSource() { + if (inlineSourceBuilder_ == null) { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + } + inlineSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource inline_source = 2; + * + */ + public com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.Builder + getInlineSourceBuilder() { + return getInlineSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource inline_source = 2; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSourceOrBuilder + getInlineSourceOrBuilder() { + if ((sourceCase_ == 2) && (inlineSourceBuilder_ != null)) { + return inlineSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 2) { + return (com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource) + source_; + } + return com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + .getDefaultInstance(); + } + } + /** + * + * + *
+     * The Inline source for the input content for UserEvents.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource inline_source = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource, + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.Builder, + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSourceOrBuilder> + getInlineSourceFieldBuilder() { + if (inlineSourceBuilder_ == null) { + if (!(sourceCase_ == 2)) { + source_ = + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + .getDefaultInstance(); + } + inlineSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource, + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + .Builder, + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest + .InlineSourceOrBuilder>( + (com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource) + source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 2; + onChanged(); + return inlineSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.GcsSource, + com.google.cloud.discoveryengine.v1alpha.GcsSource.Builder, + com.google.cloud.discoveryengine.v1alpha.GcsSourceOrBuilder> + gcsSourceBuilder_; + /** + * + * + *
+     * Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return sourceCase_ == 3; + } + /** + * + * + *
+     * Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 3) { + return (com.google.cloud.discoveryengine.v1alpha.GcsSource) source_; + } + return com.google.cloud.discoveryengine.v1alpha.GcsSource.getDefaultInstance(); + } else { + if (sourceCase_ == 3) { + return gcsSourceBuilder_.getMessage(); + } + return com.google.cloud.discoveryengine.v1alpha.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + */ + public Builder setGcsSource(com.google.cloud.discoveryengine.v1alpha.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + gcsSourceBuilder_.setMessage(value); + } + sourceCase_ = 3; + return this; + } + /** + * + * + *
+     * Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + */ + public Builder setGcsSource( + com.google.cloud.discoveryengine.v1alpha.GcsSource.Builder builderForValue) { + if (gcsSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + gcsSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 3; + return this; + } + /** + * + * + *
+     * Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + */ + public Builder mergeGcsSource(com.google.cloud.discoveryengine.v1alpha.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 3 + && source_ != com.google.cloud.discoveryengine.v1alpha.GcsSource.getDefaultInstance()) { + source_ = + com.google.cloud.discoveryengine.v1alpha.GcsSource.newBuilder( + (com.google.cloud.discoveryengine.v1alpha.GcsSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 3) { + gcsSourceBuilder_.mergeFrom(value); + } else { + gcsSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 3; + return this; + } + /** + * + * + *
+     * Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + */ + public Builder clearGcsSource() { + if (gcsSourceBuilder_ == null) { + if (sourceCase_ == 3) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 3) { + sourceCase_ = 0; + source_ = null; + } + gcsSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + */ + public com.google.cloud.discoveryengine.v1alpha.GcsSource.Builder getGcsSourceBuilder() { + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if ((sourceCase_ == 3) && (gcsSourceBuilder_ != null)) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 3) { + return (com.google.cloud.discoveryengine.v1alpha.GcsSource) source_; + } + return com.google.cloud.discoveryengine.v1alpha.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * Cloud Storage location for the input content.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.GcsSource, + com.google.cloud.discoveryengine.v1alpha.GcsSource.Builder, + com.google.cloud.discoveryengine.v1alpha.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + if (!(sourceCase_ == 3)) { + source_ = com.google.cloud.discoveryengine.v1alpha.GcsSource.getDefaultInstance(); + } + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.GcsSource, + com.google.cloud.discoveryengine.v1alpha.GcsSource.Builder, + com.google.cloud.discoveryengine.v1alpha.GcsSourceOrBuilder>( + (com.google.cloud.discoveryengine.v1alpha.GcsSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 3; + onChanged(); + return gcsSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.BigQuerySource, + com.google.cloud.discoveryengine.v1alpha.BigQuerySource.Builder, + com.google.cloud.discoveryengine.v1alpha.BigQuerySourceOrBuilder> + bigquerySourceBuilder_; + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + * + * @return Whether the bigquerySource field is set. + */ + @java.lang.Override + public boolean hasBigquerySource() { + return sourceCase_ == 4; + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + * + * @return The bigquerySource. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.BigQuerySource getBigquerySource() { + if (bigquerySourceBuilder_ == null) { + if (sourceCase_ == 4) { + return (com.google.cloud.discoveryengine.v1alpha.BigQuerySource) source_; + } + return com.google.cloud.discoveryengine.v1alpha.BigQuerySource.getDefaultInstance(); + } else { + if (sourceCase_ == 4) { + return bigquerySourceBuilder_.getMessage(); + } + return com.google.cloud.discoveryengine.v1alpha.BigQuerySource.getDefaultInstance(); + } + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + */ + public Builder setBigquerySource( + com.google.cloud.discoveryengine.v1alpha.BigQuerySource value) { + if (bigquerySourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + bigquerySourceBuilder_.setMessage(value); + } + sourceCase_ = 4; + return this; + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + */ + public Builder setBigquerySource( + com.google.cloud.discoveryengine.v1alpha.BigQuerySource.Builder builderForValue) { + if (bigquerySourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + bigquerySourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 4; + return this; + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + */ + public Builder mergeBigquerySource( + com.google.cloud.discoveryengine.v1alpha.BigQuerySource value) { + if (bigquerySourceBuilder_ == null) { + if (sourceCase_ == 4 + && source_ + != com.google.cloud.discoveryengine.v1alpha.BigQuerySource.getDefaultInstance()) { + source_ = + com.google.cloud.discoveryengine.v1alpha.BigQuerySource.newBuilder( + (com.google.cloud.discoveryengine.v1alpha.BigQuerySource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 4) { + bigquerySourceBuilder_.mergeFrom(value); + } else { + bigquerySourceBuilder_.setMessage(value); + } + } + sourceCase_ = 4; + return this; + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + */ + public Builder clearBigquerySource() { + if (bigquerySourceBuilder_ == null) { + if (sourceCase_ == 4) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 4) { + sourceCase_ = 0; + source_ = null; + } + bigquerySourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + */ + public com.google.cloud.discoveryengine.v1alpha.BigQuerySource.Builder + getBigquerySourceBuilder() { + return getBigquerySourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.BigQuerySourceOrBuilder + getBigquerySourceOrBuilder() { + if ((sourceCase_ == 4) && (bigquerySourceBuilder_ != null)) { + return bigquerySourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 4) { + return (com.google.cloud.discoveryengine.v1alpha.BigQuerySource) source_; + } + return com.google.cloud.discoveryengine.v1alpha.BigQuerySource.getDefaultInstance(); + } + } + /** + * + * + *
+     * BigQuery input source.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.BigQuerySource, + com.google.cloud.discoveryengine.v1alpha.BigQuerySource.Builder, + com.google.cloud.discoveryengine.v1alpha.BigQuerySourceOrBuilder> + getBigquerySourceFieldBuilder() { + if (bigquerySourceBuilder_ == null) { + if (!(sourceCase_ == 4)) { + source_ = com.google.cloud.discoveryengine.v1alpha.BigQuerySource.getDefaultInstance(); + } + bigquerySourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.BigQuerySource, + com.google.cloud.discoveryengine.v1alpha.BigQuerySource.Builder, + com.google.cloud.discoveryengine.v1alpha.BigQuerySourceOrBuilder>( + (com.google.cloud.discoveryengine.v1alpha.BigQuerySource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 4; + onChanged(); + return bigquerySourceBuilder_; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Parent DataStore resource name, of the form
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`
+     * 
+ * + * + * 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. Parent DataStore resource name, of the form
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`
+     * 
+ * + * + * 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. Parent DataStore resource name, of the form
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent DataStore resource name, of the form
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent DataStore resource name, of the form
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig errorConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.Builder, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder> + errorConfigBuilder_; + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + * + * @return Whether the errorConfig field is set. + */ + public boolean hasErrorConfig() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + * + * @return The errorConfig. + */ + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig getErrorConfig() { + if (errorConfigBuilder_ == null) { + return errorConfig_ == null + ? com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.getDefaultInstance() + : errorConfig_; + } else { + return errorConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + */ + public Builder setErrorConfig( + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig value) { + if (errorConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorConfig_ = value; + } else { + errorConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + */ + public Builder setErrorConfig( + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.Builder builderForValue) { + if (errorConfigBuilder_ == null) { + errorConfig_ = builderForValue.build(); + } else { + errorConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + */ + public Builder mergeErrorConfig( + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig value) { + if (errorConfigBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && errorConfig_ != null + && errorConfig_ + != com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig + .getDefaultInstance()) { + getErrorConfigBuilder().mergeFrom(value); + } else { + errorConfig_ = value; + } + } else { + errorConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + */ + public Builder clearErrorConfig() { + bitField0_ = (bitField0_ & ~0x00000010); + errorConfig_ = null; + if (errorConfigBuilder_ != null) { + errorConfigBuilder_.dispose(); + errorConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + */ + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.Builder + getErrorConfigBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getErrorConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + */ + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder + getErrorConfigOrBuilder() { + if (errorConfigBuilder_ != null) { + return errorConfigBuilder_.getMessageOrBuilder(); + } else { + return errorConfig_ == null + ? com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.getDefaultInstance() + : errorConfig_; + } + } + /** + * + * + *
+     * The desired location of errors incurred during the Import. Cannot be set
+     * for inline user event imports.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.Builder, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder> + getErrorConfigFieldBuilder() { + if (errorConfigBuilder_ == null) { + errorConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.Builder, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder>( + getErrorConfig(), getParentForChildren(), isClean()); + errorConfig_ = null; + } + return errorConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest) + private static final com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsRequestOrBuilder.java new file mode 100644 index 000000000000..c69b02629e61 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsRequestOrBuilder.java @@ -0,0 +1,208 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/import_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface ImportUserEventsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource inline_source = 2; + * + * + * @return Whether the inlineSource field is set. + */ + boolean hasInlineSource(); + /** + * + * + *
+   * The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource inline_source = 2; + * + * + * @return The inlineSource. + */ + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource getInlineSource(); + /** + * + * + *
+   * The Inline source for the input content for UserEvents.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource inline_source = 2; + * + */ + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSourceOrBuilder + getInlineSourceOrBuilder(); + + /** + * + * + *
+   * Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + * + * @return Whether the gcsSource field is set. + */ + boolean hasGcsSource(); + /** + * + * + *
+   * Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + * + * @return The gcsSource. + */ + com.google.cloud.discoveryengine.v1alpha.GcsSource getGcsSource(); + /** + * + * + *
+   * Cloud Storage location for the input content.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.GcsSource gcs_source = 3; + */ + com.google.cloud.discoveryengine.v1alpha.GcsSourceOrBuilder getGcsSourceOrBuilder(); + + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + * + * @return Whether the bigquerySource field is set. + */ + boolean hasBigquerySource(); + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + * + * @return The bigquerySource. + */ + com.google.cloud.discoveryengine.v1alpha.BigQuerySource getBigquerySource(); + /** + * + * + *
+   * BigQuery input source.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.BigQuerySource bigquery_source = 4; + */ + com.google.cloud.discoveryengine.v1alpha.BigQuerySourceOrBuilder getBigquerySourceOrBuilder(); + + /** + * + * + *
+   * Required. Parent DataStore resource name, of the form
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent DataStore resource name, of the form
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The desired location of errors incurred during the Import. Cannot be set
+   * for inline user event imports.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + * + * @return Whether the errorConfig field is set. + */ + boolean hasErrorConfig(); + /** + * + * + *
+   * The desired location of errors incurred during the Import. Cannot be set
+   * for inline user event imports.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + * + * @return The errorConfig. + */ + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig getErrorConfig(); + /** + * + * + *
+   * The desired location of errors incurred during the Import. Cannot be set
+   * for inline user event imports.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 5; + */ + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder getErrorConfigOrBuilder(); + + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.SourceCase getSourceCase(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsResponse.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsResponse.java new file mode 100644 index 000000000000..26994dc43853 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsResponse.java @@ -0,0 +1,1411 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/import_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * 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.discoveryengine.v1alpha.ImportUserEventsResponse} + */ +public final class ImportUserEventsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse.class, + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse.Builder.class); + } + + public static final int ERROR_SAMPLES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List errorSamples_; + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesOrBuilderList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public int getErrorSamplesCount() { + return errorSamples_.size(); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.Status getErrorSamples(int index) { + return errorSamples_.get(index); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + return errorSamples_.get(index); + } + + public static final int ERROR_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig errorConfig_; + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + * + * @return Whether the errorConfig field is set. + */ + @java.lang.Override + public boolean hasErrorConfig() { + return errorConfig_ != null; + } + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + * + * @return The errorConfig. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig getErrorConfig() { + return errorConfig_ == null + ? com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.getDefaultInstance() + : errorConfig_; + } + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder + getErrorConfigOrBuilder() { + return errorConfig_ == null + ? com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.getDefaultInstance() + : errorConfig_; + } + + public static final int JOINED_EVENTS_COUNT_FIELD_NUMBER = 3; + private long joinedEventsCount_ = 0L; + /** + * + * + *
+   * Count of user events imported with complete existing Documents.
+   * 
+ * + * int64 joined_events_count = 3; + * + * @return The joinedEventsCount. + */ + @java.lang.Override + public long getJoinedEventsCount() { + return joinedEventsCount_; + } + + public static final int UNJOINED_EVENTS_COUNT_FIELD_NUMBER = 4; + private long unjoinedEventsCount_ = 0L; + /** + * + * + *
+   * Count of user events imported, but with Document information not found
+   * in the existing Branch.
+   * 
+ * + * int64 unjoined_events_count = 4; + * + * @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 { + for (int i = 0; i < errorSamples_.size(); i++) { + output.writeMessage(1, errorSamples_.get(i)); + } + if (errorConfig_ != null) { + output.writeMessage(2, getErrorConfig()); + } + if (joinedEventsCount_ != 0L) { + output.writeInt64(3, joinedEventsCount_); + } + if (unjoinedEventsCount_ != 0L) { + output.writeInt64(4, unjoinedEventsCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < errorSamples_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, errorSamples_.get(i)); + } + if (errorConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getErrorConfig()); + } + if (joinedEventsCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, joinedEventsCount_); + } + if (unjoinedEventsCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, unjoinedEventsCount_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse other = + (com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse) obj; + + if (!getErrorSamplesList().equals(other.getErrorSamplesList())) return false; + if (hasErrorConfig() != other.hasErrorConfig()) return false; + if (hasErrorConfig()) { + if (!getErrorConfig().equals(other.getErrorConfig())) return false; + } + if (getJoinedEventsCount() != other.getJoinedEventsCount()) return false; + if (getUnjoinedEventsCount() != other.getUnjoinedEventsCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getErrorSamplesCount() > 0) { + hash = (37 * hash) + ERROR_SAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getErrorSamplesList().hashCode(); + } + if (hasErrorConfig()) { + hash = (37 * hash) + ERROR_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getErrorConfig().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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.ImportUserEventsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.ImportUserEventsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.ImportUserEventsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.ImportUserEventsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.ImportUserEventsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse) + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse.class, + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + } else { + errorSamples_ = null; + errorSamplesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + errorConfig_ = null; + if (errorConfigBuilder_ != null) { + errorConfigBuilder_.dispose(); + errorConfigBuilder_ = null; + } + joinedEventsCount_ = 0L; + unjoinedEventsCount_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ImportConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_ImportUserEventsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse build() { + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse buildPartial() { + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse result = + new com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse result) { + if (errorSamplesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.errorSamples_ = errorSamples_; + } else { + result.errorSamples_ = errorSamplesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.errorConfig_ = + errorConfigBuilder_ == null ? errorConfig_ : errorConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.joinedEventsCount_ = joinedEventsCount_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.unjoinedEventsCount_ = unjoinedEventsCount_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.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.hasErrorConfig()) { + mergeErrorConfig(other.getErrorConfig()); + } + if (other.getJoinedEventsCount() != 0L) { + setJoinedEventsCount(other.getJoinedEventsCount()); + } + if (other.getUnjoinedEventsCount() != 0L) { + setUnjoinedEventsCount(other.getUnjoinedEventsCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.rpc.Status m = + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(m); + } else { + errorSamplesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + input.readMessage(getErrorConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + joinedEventsCount_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + unjoinedEventsCount_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List errorSamples_ = java.util.Collections.emptyList(); + + private void ensureErrorSamplesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = new java.util.ArrayList(errorSamples_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorSamplesBuilder_; + + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesList() { + if (errorSamplesBuilder_ == null) { + return java.util.Collections.unmodifiableList(errorSamples_); + } else { + return errorSamplesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public int getErrorSamplesCount() { + if (errorSamplesBuilder_ == null) { + return errorSamples_.size(); + } else { + return errorSamplesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status getErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, value); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addAllErrorSamples(java.lang.Iterable values) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, errorSamples_); + onChanged(); + } else { + errorSamplesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder clearErrorSamples() { + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + errorSamplesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder removeErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.remove(index); + onChanged(); + } else { + errorSamplesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder getErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesOrBuilderList() { + if (errorSamplesBuilder_ != null) { + return errorSamplesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(errorSamples_); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder() { + return getErrorSamplesFieldBuilder().addBuilder(com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder() + .addBuilder(index, com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesBuilderList() { + return getErrorSamplesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorSamplesFieldBuilder() { + if (errorSamplesBuilder_ == null) { + errorSamplesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + errorSamples_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + errorSamples_ = null; + } + return errorSamplesBuilder_; + } + + private com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig errorConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.Builder, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder> + errorConfigBuilder_; + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + * + * @return Whether the errorConfig field is set. + */ + public boolean hasErrorConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + * + * @return The errorConfig. + */ + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig getErrorConfig() { + if (errorConfigBuilder_ == null) { + return errorConfig_ == null + ? com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.getDefaultInstance() + : errorConfig_; + } else { + return errorConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + */ + public Builder setErrorConfig( + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig value) { + if (errorConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorConfig_ = value; + } else { + errorConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + */ + public Builder setErrorConfig( + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.Builder builderForValue) { + if (errorConfigBuilder_ == null) { + errorConfig_ = builderForValue.build(); + } else { + errorConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + */ + public Builder mergeErrorConfig( + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig value) { + if (errorConfigBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && errorConfig_ != null + && errorConfig_ + != com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig + .getDefaultInstance()) { + getErrorConfigBuilder().mergeFrom(value); + } else { + errorConfig_ = value; + } + } else { + errorConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + */ + public Builder clearErrorConfig() { + bitField0_ = (bitField0_ & ~0x00000002); + errorConfig_ = null; + if (errorConfigBuilder_ != null) { + errorConfigBuilder_.dispose(); + errorConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.Builder + getErrorConfigBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getErrorConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder + getErrorConfigOrBuilder() { + if (errorConfigBuilder_ != null) { + return errorConfigBuilder_.getMessageOrBuilder(); + } else { + return errorConfig_ == null + ? com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.getDefaultInstance() + : errorConfig_; + } + } + /** + * + * + *
+     * Echoes the destination for the complete errors if this field was set in
+     * the request.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.Builder, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder> + getErrorConfigFieldBuilder() { + if (errorConfigBuilder_ == null) { + errorConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.Builder, + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder>( + getErrorConfig(), getParentForChildren(), isClean()); + errorConfig_ = null; + } + return errorConfigBuilder_; + } + + private long joinedEventsCount_; + /** + * + * + *
+     * Count of user events imported with complete existing Documents.
+     * 
+ * + * int64 joined_events_count = 3; + * + * @return The joinedEventsCount. + */ + @java.lang.Override + public long getJoinedEventsCount() { + return joinedEventsCount_; + } + /** + * + * + *
+     * Count of user events imported with complete existing Documents.
+     * 
+ * + * int64 joined_events_count = 3; + * + * @param value The joinedEventsCount to set. + * @return This builder for chaining. + */ + public Builder setJoinedEventsCount(long value) { + + joinedEventsCount_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of user events imported with complete existing Documents.
+     * 
+ * + * int64 joined_events_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearJoinedEventsCount() { + bitField0_ = (bitField0_ & ~0x00000004); + joinedEventsCount_ = 0L; + onChanged(); + return this; + } + + private long unjoinedEventsCount_; + /** + * + * + *
+     * Count of user events imported, but with Document information not found
+     * in the existing Branch.
+     * 
+ * + * int64 unjoined_events_count = 4; + * + * @return The unjoinedEventsCount. + */ + @java.lang.Override + public long getUnjoinedEventsCount() { + return unjoinedEventsCount_; + } + /** + * + * + *
+     * Count of user events imported, but with Document information not found
+     * in the existing Branch.
+     * 
+ * + * int64 unjoined_events_count = 4; + * + * @param value The unjoinedEventsCount to set. + * @return This builder for chaining. + */ + public Builder setUnjoinedEventsCount(long value) { + + unjoinedEventsCount_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of user events imported, but with Document information not found
+     * in the existing Branch.
+     * 
+ * + * int64 unjoined_events_count = 4; + * + * @return This builder for chaining. + */ + public Builder clearUnjoinedEventsCount() { + bitField0_ = (bitField0_ & ~0x00000008); + 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.discoveryengine.v1alpha.ImportUserEventsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse) + private static final com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsResponseOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsResponseOrBuilder.java new file mode 100644 index 000000000000..18f597c8a4a7 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ImportUserEventsResponseOrBuilder.java @@ -0,0 +1,141 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/import_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface ImportUserEventsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + * + * @return Whether the errorConfig field is set. + */ + boolean hasErrorConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + * + * @return The errorConfig. + */ + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig getErrorConfig(); + /** + * + * + *
+   * Echoes the destination for the complete errors if this field was set in
+   * the request.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ImportErrorConfig error_config = 2; + */ + com.google.cloud.discoveryengine.v1alpha.ImportErrorConfigOrBuilder getErrorConfigOrBuilder(); + + /** + * + * + *
+   * Count of user events imported with complete existing Documents.
+   * 
+ * + * int64 joined_events_count = 3; + * + * @return The joinedEventsCount. + */ + long getJoinedEventsCount(); + + /** + * + * + *
+   * Count of user events imported, but with Document information not found
+   * in the existing Branch.
+   * 
+ * + * int64 unjoined_events_count = 4; + * + * @return The unjoinedEventsCount. + */ + long getUnjoinedEventsCount(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/Interval.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/Interval.java new file mode 100644 index 000000000000..b8b0218fbef8 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/Interval.java @@ -0,0 +1,1149 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/common.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * A floating point interval.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.Interval} + */ +public final class Interval extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.CommonProto + .internal_static_google_cloud_discoveryengine_v1alpha_Interval_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.CommonProto + .internal_static_google_cloud_discoveryengine_v1alpha_Interval_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.Interval.class, + com.google.cloud.discoveryengine.v1alpha.Interval.Builder.class); + } + + private int minCase_ = 0; + + @SuppressWarnings("serial") + 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; + + @SuppressWarnings("serial") + 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_)); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.Interval)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.Interval other = + (com.google.cloud.discoveryengine.v1alpha.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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.Interval parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.Interval parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.Interval parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.Interval parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Interval parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.Interval parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.Interval parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.Interval} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.Interval) + com.google.cloud.discoveryengine.v1alpha.IntervalOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.CommonProto + .internal_static_google_cloud_discoveryengine_v1alpha_Interval_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.CommonProto + .internal_static_google_cloud_discoveryengine_v1alpha_Interval_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.Interval.class, + com.google.cloud.discoveryengine.v1alpha.Interval.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.Interval.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + minCase_ = 0; + min_ = null; + maxCase_ = 0; + max_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.CommonProto + .internal_static_google_cloud_discoveryengine_v1alpha_Interval_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Interval getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.Interval.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Interval build() { + com.google.cloud.discoveryengine.v1alpha.Interval result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Interval buildPartial() { + com.google.cloud.discoveryengine.v1alpha.Interval result = + new com.google.cloud.discoveryengine.v1alpha.Interval(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.Interval result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.discoveryengine.v1alpha.Interval result) { + result.minCase_ = minCase_; + result.min_ = this.min_; + result.maxCase_ = maxCase_; + result.max_ = this.max_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.Interval) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.Interval) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.Interval other) { + if (other == com.google.cloud.discoveryengine.v1alpha.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.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: + { + min_ = input.readDouble(); + minCase_ = 1; + break; + } // case 9 + case 17: + { + min_ = input.readDouble(); + minCase_ = 2; + break; + } // case 17 + case 25: + { + max_ = input.readDouble(); + maxCase_ = 3; + break; + } // case 25 + case 33: + { + max_ = input.readDouble(); + maxCase_ = 4; + break; + } // case 33 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int 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; + } + + private int bitField0_; + + /** + * + * + *
+     * 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.discoveryengine.v1alpha.Interval) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.Interval) + private static final com.google.cloud.discoveryengine.v1alpha.Interval DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.Interval(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Interval getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/IntervalOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/IntervalOrBuilder.java new file mode 100644 index 000000000000..500ccebb7f5b --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/IntervalOrBuilder.java @@ -0,0 +1,129 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/common.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface IntervalOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.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(); + + com.google.cloud.discoveryengine.v1alpha.Interval.MinCase getMinCase(); + + com.google.cloud.discoveryengine.v1alpha.Interval.MaxCase getMaxCase(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListConversationsRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListConversationsRequest.java new file mode 100644 index 000000000000..de86872a78d5 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListConversationsRequest.java @@ -0,0 +1,1396 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request for ListConversations method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ListConversationsRequest} + */ +public final class ListConversationsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.ListConversationsRequest) + ListConversationsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListConversationsRequest.newBuilder() to construct. + private ListConversationsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListConversationsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListConversationsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListConversationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListConversationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest.class, + com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The data store resource name. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_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 data store resource name. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_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_ = 0; + /** + * + * + *
+   * Maximum number of results to return. If unspecified, defaults
+   * to 50. Max allowed value is 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A page token, received from a previous `ListConversations` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * 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, received from a previous `ListConversations` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * 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; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * A filter to apply on the list results. The supported features are:
+   * user_pseudo_id, state.
+   *
+   * Example:
+   * "user_pseudo_id = some_id"
+   * 
+ * + * 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. The supported features are:
+   * user_pseudo_id, state.
+   *
+   * Example:
+   * "user_pseudo_id = some_id"
+   * 
+ * + * 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 ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * A comma-separated list of fields to order by, sorted in ascending order.
+   * Use "desc" after a field name for descending.
+   * Supported fields:
+   *   * `update_time`
+   *   * `create_time`
+   *   * `conversation_name`
+   *
+   * Example:
+   * "update_time desc"
+   * "create_time"
+   * 
+ * + * string order_by = 5; + * + * @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; + } + } + /** + * + * + *
+   * A comma-separated list of fields to order by, sorted in ascending order.
+   * Use "desc" after a field name for descending.
+   * Supported fields:
+   *   * `update_time`
+   *   * `create_time`
+   *   * `conversation_name`
+   *
+   * Example:
+   * "update_time desc"
+   * "create_time"
+   * 
+ * + * string order_by = 5; + * + * @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; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest other = + (com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest) 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 (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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 = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 ListConversations method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ListConversationsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.ListConversationsRequest) + com.google.cloud.discoveryengine.v1alpha.ListConversationsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListConversationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListConversationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest.class, + com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListConversationsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest build() { + com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest result = + new com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The data store resource name. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_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 data store resource name. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_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 data store resource name. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The data store resource name. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The data store resource name. Format:
+     * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Maximum number of results to return. If unspecified, defaults
+     * to 50. Max allowed value is 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of results to return. If unspecified, defaults
+     * to 50. Max allowed value is 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of results to return. If unspecified, defaults
+     * to 50. Max allowed value is 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token, received from a previous `ListConversations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * 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, received from a previous `ListConversations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * 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, received from a previous `ListConversations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListConversations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListConversations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * A filter to apply on the list results. The supported features are:
+     * user_pseudo_id, state.
+     *
+     * Example:
+     * "user_pseudo_id = some_id"
+     * 
+ * + * 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. The supported features are:
+     * user_pseudo_id, state.
+     *
+     * Example:
+     * "user_pseudo_id = some_id"
+     * 
+ * + * 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. The supported features are:
+     * user_pseudo_id, state.
+     *
+     * Example:
+     * "user_pseudo_id = some_id"
+     * 
+ * + * 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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * A filter to apply on the list results. The supported features are:
+     * user_pseudo_id, state.
+     *
+     * Example:
+     * "user_pseudo_id = some_id"
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * A filter to apply on the list results. The supported features are:
+     * user_pseudo_id, state.
+     *
+     * Example:
+     * "user_pseudo_id = some_id"
+     * 
+ * + * 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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * A comma-separated list of fields to order by, sorted in ascending order.
+     * Use "desc" after a field name for descending.
+     * Supported fields:
+     *   * `update_time`
+     *   * `create_time`
+     *   * `conversation_name`
+     *
+     * Example:
+     * "update_time desc"
+     * "create_time"
+     * 
+ * + * string order_by = 5; + * + * @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; + } + } + /** + * + * + *
+     * A comma-separated list of fields to order by, sorted in ascending order.
+     * Use "desc" after a field name for descending.
+     * Supported fields:
+     *   * `update_time`
+     *   * `create_time`
+     *   * `conversation_name`
+     *
+     * Example:
+     * "update_time desc"
+     * "create_time"
+     * 
+ * + * string order_by = 5; + * + * @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; + } + } + /** + * + * + *
+     * A comma-separated list of fields to order by, sorted in ascending order.
+     * Use "desc" after a field name for descending.
+     * Supported fields:
+     *   * `update_time`
+     *   * `create_time`
+     *   * `conversation_name`
+     *
+     * Example:
+     * "update_time desc"
+     * "create_time"
+     * 
+ * + * string order_by = 5; + * + * @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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * A comma-separated list of fields to order by, sorted in ascending order.
+     * Use "desc" after a field name for descending.
+     * Supported fields:
+     *   * `update_time`
+     *   * `create_time`
+     *   * `conversation_name`
+     *
+     * Example:
+     * "update_time desc"
+     * "create_time"
+     * 
+ * + * string order_by = 5; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * A comma-separated list of fields to order by, sorted in ascending order.
+     * Use "desc" after a field name for descending.
+     * Supported fields:
+     *   * `update_time`
+     *   * `create_time`
+     *   * `conversation_name`
+     *
+     * Example:
+     * "update_time desc"
+     * "create_time"
+     * 
+ * + * string order_by = 5; + * + * @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; + bitField0_ |= 0x00000010; + 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.discoveryengine.v1alpha.ListConversationsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.ListConversationsRequest) + private static final com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListConversationsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListConversationsRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListConversationsRequestOrBuilder.java new file mode 100644 index 000000000000..20595fe41c49 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListConversationsRequestOrBuilder.java @@ -0,0 +1,173 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface ListConversationsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.ListConversationsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The data store resource name. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The data store resource name. Format:
+   * `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
+   * 
+ * + * + * 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 results to return. If unspecified, defaults
+   * to 50. Max allowed value is 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListConversations` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token, received from a previous `ListConversations` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * A filter to apply on the list results. The supported features are:
+   * user_pseudo_id, state.
+   *
+   * Example:
+   * "user_pseudo_id = some_id"
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * A filter to apply on the list results. The supported features are:
+   * user_pseudo_id, state.
+   *
+   * Example:
+   * "user_pseudo_id = some_id"
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * A comma-separated list of fields to order by, sorted in ascending order.
+   * Use "desc" after a field name for descending.
+   * Supported fields:
+   *   * `update_time`
+   *   * `create_time`
+   *   * `conversation_name`
+   *
+   * Example:
+   * "update_time desc"
+   * "create_time"
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * A comma-separated list of fields to order by, sorted in ascending order.
+   * Use "desc" after a field name for descending.
+   * Supported fields:
+   *   * `update_time`
+   *   * `create_time`
+   *   * `conversation_name`
+   *
+   * Example:
+   * "update_time desc"
+   * "create_time"
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListConversationsResponse.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListConversationsResponse.java new file mode 100644 index 000000000000..e88200c3a508 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListConversationsResponse.java @@ -0,0 +1,1146 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Response for ListConversations method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ListConversationsResponse} + */ +public final class ListConversationsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.ListConversationsResponse) + ListConversationsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListConversationsResponse.newBuilder() to construct. + private ListConversationsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListConversationsResponse() { + conversations_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListConversationsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListConversationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListConversationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse.class, + com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse.Builder.class); + } + + public static final int CONVERSATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List conversations_; + /** + * + * + *
+   * All the Conversations for a given data store.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + @java.lang.Override + public java.util.List + getConversationsList() { + return conversations_; + } + /** + * + * + *
+   * All the Conversations for a given data store.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + @java.lang.Override + public java.util.List + getConversationsOrBuilderList() { + return conversations_; + } + /** + * + * + *
+   * All the Conversations for a given data store.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + @java.lang.Override + public int getConversationsCount() { + return conversations_.size(); + } + /** + * + * + *
+   * All the Conversations for a given data store.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Conversation getConversations(int index) { + return conversations_.get(index); + } + /** + * + * + *
+   * All the Conversations for a given data store.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder getConversationsOrBuilder( + int index) { + return conversations_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + 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 < conversations_.size(); i++) { + output.writeMessage(1, conversations_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < conversations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, conversations_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse other = + (com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse) obj; + + if (!getConversationsList().equals(other.getConversationsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getConversationsCount() > 0) { + hash = (37 * hash) + CONVERSATIONS_FIELD_NUMBER; + hash = (53 * hash) + getConversationsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 ListConversations method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ListConversationsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.ListConversationsResponse) + com.google.cloud.discoveryengine.v1alpha.ListConversationsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListConversationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListConversationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse.class, + com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (conversationsBuilder_ == null) { + conversations_ = java.util.Collections.emptyList(); + } else { + conversations_ = null; + conversationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListConversationsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse build() { + com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse buildPartial() { + com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse result = + new com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse result) { + if (conversationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + conversations_ = java.util.Collections.unmodifiableList(conversations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.conversations_ = conversations_; + } else { + result.conversations_ = conversationsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse + .getDefaultInstance()) return this; + if (conversationsBuilder_ == null) { + if (!other.conversations_.isEmpty()) { + if (conversations_.isEmpty()) { + conversations_ = other.conversations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConversationsIsMutable(); + conversations_.addAll(other.conversations_); + } + onChanged(); + } + } else { + if (!other.conversations_.isEmpty()) { + if (conversationsBuilder_.isEmpty()) { + conversationsBuilder_.dispose(); + conversationsBuilder_ = null; + conversations_ = other.conversations_; + bitField0_ = (bitField0_ & ~0x00000001); + conversationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConversationsFieldBuilder() + : null; + } else { + conversationsBuilder_.addAllMessages(other.conversations_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.discoveryengine.v1alpha.Conversation m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.Conversation.parser(), + extensionRegistry); + if (conversationsBuilder_ == null) { + ensureConversationsIsMutable(); + conversations_.add(m); + } else { + conversationsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List conversations_ = + java.util.Collections.emptyList(); + + private void ensureConversationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + conversations_ = + new java.util.ArrayList( + conversations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Conversation, + com.google.cloud.discoveryengine.v1alpha.Conversation.Builder, + com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder> + conversationsBuilder_; + + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + public java.util.List + getConversationsList() { + if (conversationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(conversations_); + } else { + return conversationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + public int getConversationsCount() { + if (conversationsBuilder_ == null) { + return conversations_.size(); + } else { + return conversationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + public com.google.cloud.discoveryengine.v1alpha.Conversation getConversations(int index) { + if (conversationsBuilder_ == null) { + return conversations_.get(index); + } else { + return conversationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + public Builder setConversations( + int index, com.google.cloud.discoveryengine.v1alpha.Conversation value) { + if (conversationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConversationsIsMutable(); + conversations_.set(index, value); + onChanged(); + } else { + conversationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + public Builder setConversations( + int index, com.google.cloud.discoveryengine.v1alpha.Conversation.Builder builderForValue) { + if (conversationsBuilder_ == null) { + ensureConversationsIsMutable(); + conversations_.set(index, builderForValue.build()); + onChanged(); + } else { + conversationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + public Builder addConversations(com.google.cloud.discoveryengine.v1alpha.Conversation value) { + if (conversationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConversationsIsMutable(); + conversations_.add(value); + onChanged(); + } else { + conversationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + public Builder addConversations( + int index, com.google.cloud.discoveryengine.v1alpha.Conversation value) { + if (conversationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConversationsIsMutable(); + conversations_.add(index, value); + onChanged(); + } else { + conversationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + public Builder addConversations( + com.google.cloud.discoveryengine.v1alpha.Conversation.Builder builderForValue) { + if (conversationsBuilder_ == null) { + ensureConversationsIsMutable(); + conversations_.add(builderForValue.build()); + onChanged(); + } else { + conversationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + public Builder addConversations( + int index, com.google.cloud.discoveryengine.v1alpha.Conversation.Builder builderForValue) { + if (conversationsBuilder_ == null) { + ensureConversationsIsMutable(); + conversations_.add(index, builderForValue.build()); + onChanged(); + } else { + conversationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + public Builder addAllConversations( + java.lang.Iterable + values) { + if (conversationsBuilder_ == null) { + ensureConversationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, conversations_); + onChanged(); + } else { + conversationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + public Builder clearConversations() { + if (conversationsBuilder_ == null) { + conversations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + conversationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + public Builder removeConversations(int index) { + if (conversationsBuilder_ == null) { + ensureConversationsIsMutable(); + conversations_.remove(index); + onChanged(); + } else { + conversationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + public com.google.cloud.discoveryengine.v1alpha.Conversation.Builder getConversationsBuilder( + int index) { + return getConversationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + public com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder getConversationsOrBuilder( + int index) { + if (conversationsBuilder_ == null) { + return conversations_.get(index); + } else { + return conversationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + public java.util.List + getConversationsOrBuilderList() { + if (conversationsBuilder_ != null) { + return conversationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(conversations_); + } + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + public com.google.cloud.discoveryengine.v1alpha.Conversation.Builder addConversationsBuilder() { + return getConversationsFieldBuilder() + .addBuilder(com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance()); + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + public com.google.cloud.discoveryengine.v1alpha.Conversation.Builder addConversationsBuilder( + int index) { + return getConversationsFieldBuilder() + .addBuilder( + index, com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance()); + } + /** + * + * + *
+     * All the Conversations for a given data store.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + public java.util.List + getConversationsBuilderList() { + return getConversationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Conversation, + com.google.cloud.discoveryengine.v1alpha.Conversation.Builder, + com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder> + getConversationsFieldBuilder() { + if (conversationsBuilder_ == null) { + conversationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Conversation, + com.google.cloud.discoveryengine.v1alpha.Conversation.Builder, + com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder>( + conversations_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + conversations_ = null; + } + return conversationsBuilder_; + } + + 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; + bitField0_ |= 0x00000002; + 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(); + bitField0_ = (bitField0_ & ~0x00000002); + 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; + bitField0_ |= 0x00000002; + 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.discoveryengine.v1alpha.ListConversationsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.ListConversationsResponse) + private static final com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse(); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListConversationsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListConversationsResponseOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListConversationsResponseOrBuilder.java new file mode 100644 index 000000000000..1f373e8d49cb --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListConversationsResponseOrBuilder.java @@ -0,0 +1,103 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface ListConversationsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.ListConversationsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * All the Conversations for a given data store.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + java.util.List getConversationsList(); + /** + * + * + *
+   * All the Conversations for a given data store.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + com.google.cloud.discoveryengine.v1alpha.Conversation getConversations(int index); + /** + * + * + *
+   * All the Conversations for a given data store.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + int getConversationsCount(); + /** + * + * + *
+   * All the Conversations for a given data store.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + java.util.List + getConversationsOrBuilderList(); + /** + * + * + *
+   * All the Conversations for a given data store.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Conversation conversations = 1; + */ + com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder getConversationsOrBuilder( + int index); + + /** + * + * + *
+   * Pagination token, if not returned indicates the last page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Pagination token, if not returned indicates the last page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListDocumentsRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListDocumentsRequest.java new file mode 100644 index 000000000000..b44d2fd02e3a --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListDocumentsRequest.java @@ -0,0 +1,1061 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/document_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request message for
+ * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ListDocumentsRequest} + */ +public final class ListDocumentsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.ListDocumentsRequest) + ListDocumentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDocumentsRequest.newBuilder() to construct. + private ListDocumentsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDocumentsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListDocumentsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListDocumentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListDocumentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest.class, + com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent branch resource name, such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+   * Use `default_branch` as the branch ID, to list documents under the default
+   * branch.
+   *
+   * If the caller does not have permission to list
+   * [Document][google.cloud.discoveryengine.v1alpha.Document]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/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+   * Use `default_branch` as the branch ID, to list documents under the default
+   * branch.
+   *
+   * If the caller does not have permission to list
+   * [Document][google.cloud.discoveryengine.v1alpha.Document]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_ = 0; + /** + * + * + *
+   * Maximum number of
+   * [Document][google.cloud.discoveryengine.v1alpha.Document]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; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A page token
+   * [ListDocumentsResponse.next_page_token][google.cloud.discoveryengine.v1alpha.ListDocumentsResponse.next_page_token],
+   * received from a previous
+   * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
+   * call. Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to
+   * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
+   * 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
+   * [ListDocumentsResponse.next_page_token][google.cloud.discoveryengine.v1alpha.ListDocumentsResponse.next_page_token],
+   * received from a previous
+   * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
+   * call. Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to
+   * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
+   * 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_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest other = + (com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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
+   * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ListDocumentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.ListDocumentsRequest) + com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListDocumentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListDocumentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest.class, + com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListDocumentsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest build() { + com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest result = + new com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent branch resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+     * Use `default_branch` as the branch ID, to list documents under the default
+     * branch.
+     *
+     * If the caller does not have permission to list
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]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/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+     * Use `default_branch` as the branch ID, to list documents under the default
+     * branch.
+     *
+     * If the caller does not have permission to list
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]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/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+     * Use `default_branch` as the branch ID, to list documents under the default
+     * branch.
+     *
+     * If the caller does not have permission to list
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent branch resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+     * Use `default_branch` as the branch ID, to list documents under the default
+     * branch.
+     *
+     * If the caller does not have permission to list
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]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(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent branch resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+     * Use `default_branch` as the branch ID, to list documents under the default
+     * branch.
+     *
+     * If the caller does not have permission to list
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Maximum number of
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]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
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]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() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token
+     * [ListDocumentsResponse.next_page_token][google.cloud.discoveryengine.v1alpha.ListDocumentsResponse.next_page_token],
+     * received from a previous
+     * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
+     * 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
+     * [ListDocumentsResponse.next_page_token][google.cloud.discoveryengine.v1alpha.ListDocumentsResponse.next_page_token],
+     * received from a previous
+     * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
+     * 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
+     * [ListDocumentsResponse.next_page_token][google.cloud.discoveryengine.v1alpha.ListDocumentsResponse.next_page_token],
+     * received from a previous
+     * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
+     * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token
+     * [ListDocumentsResponse.next_page_token][google.cloud.discoveryengine.v1alpha.ListDocumentsResponse.next_page_token],
+     * received from a previous
+     * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
+     * 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(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token
+     * [ListDocumentsResponse.next_page_token][google.cloud.discoveryengine.v1alpha.ListDocumentsResponse.next_page_token],
+     * received from a previous
+     * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
+     * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.ListDocumentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.ListDocumentsRequest) + private static final com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDocumentsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListDocumentsRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListDocumentsRequestOrBuilder.java new file mode 100644 index 000000000000..d7d6d3b2106b --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListDocumentsRequestOrBuilder.java @@ -0,0 +1,131 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/document_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface ListDocumentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.ListDocumentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent branch resource name, such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+   * Use `default_branch` as the branch ID, to list documents under the default
+   * branch.
+   *
+   * If the caller does not have permission to list
+   * [Document][google.cloud.discoveryengine.v1alpha.Document]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/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+   * Use `default_branch` as the branch ID, to list documents under the default
+   * branch.
+   *
+   * If the caller does not have permission to list
+   * [Document][google.cloud.discoveryengine.v1alpha.Document]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
+   * [Document][google.cloud.discoveryengine.v1alpha.Document]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
+   * [ListDocumentsResponse.next_page_token][google.cloud.discoveryengine.v1alpha.ListDocumentsResponse.next_page_token],
+   * received from a previous
+   * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
+   * call. Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to
+   * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
+   * 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
+   * [ListDocumentsResponse.next_page_token][google.cloud.discoveryengine.v1alpha.ListDocumentsResponse.next_page_token],
+   * received from a previous
+   * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
+   * call. Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to
+   * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
+   * 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/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListDocumentsResponse.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListDocumentsResponse.java new file mode 100644 index 000000000000..9b18cb8251a4 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListDocumentsResponse.java @@ -0,0 +1,1159 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/document_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Response message for
+ * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ListDocumentsResponse} + */ +public final class ListDocumentsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.ListDocumentsResponse) + ListDocumentsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDocumentsResponse.newBuilder() to construct. + private ListDocumentsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDocumentsResponse() { + documents_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListDocumentsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListDocumentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListDocumentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse.class, + com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse.Builder.class); + } + + public static final int DOCUMENTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List documents_; + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + @java.lang.Override + public java.util.List getDocumentsList() { + return documents_; + } + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + @java.lang.Override + public java.util.List + getDocumentsOrBuilderList() { + return documents_; + } + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + @java.lang.Override + public int getDocumentsCount() { + return documents_.size(); + } + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Document getDocuments(int index) { + return documents_.get(index); + } + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder getDocumentsOrBuilder( + int index) { + return documents_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token that can be sent as
+   * [ListDocumentsRequest.page_token][google.cloud.discoveryengine.v1alpha.ListDocumentsRequest.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
+   * [ListDocumentsRequest.page_token][google.cloud.discoveryengine.v1alpha.ListDocumentsRequest.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 < documents_.size(); i++) { + output.writeMessage(1, documents_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < documents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, documents_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse other = + (com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse) obj; + + if (!getDocumentsList().equals(other.getDocumentsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDocumentsCount() > 0) { + hash = (37 * hash) + DOCUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getDocumentsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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
+   * [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ListDocumentsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.ListDocumentsResponse) + com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListDocumentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListDocumentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse.class, + com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (documentsBuilder_ == null) { + documents_ = java.util.Collections.emptyList(); + } else { + documents_ = null; + documentsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListDocumentsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse build() { + com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse buildPartial() { + com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse result = + new com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse result) { + if (documentsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + documents_ = java.util.Collections.unmodifiableList(documents_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.documents_ = documents_; + } else { + result.documents_ = documentsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse.getDefaultInstance()) + return this; + if (documentsBuilder_ == null) { + if (!other.documents_.isEmpty()) { + if (documents_.isEmpty()) { + documents_ = other.documents_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDocumentsIsMutable(); + documents_.addAll(other.documents_); + } + onChanged(); + } + } else { + if (!other.documents_.isEmpty()) { + if (documentsBuilder_.isEmpty()) { + documentsBuilder_.dispose(); + documentsBuilder_ = null; + documents_ = other.documents_; + bitField0_ = (bitField0_ & ~0x00000001); + documentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDocumentsFieldBuilder() + : null; + } else { + documentsBuilder_.addAllMessages(other.documents_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.discoveryengine.v1alpha.Document m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.Document.parser(), + extensionRegistry); + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + documents_.add(m); + } else { + documentsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List documents_ = + java.util.Collections.emptyList(); + + private void ensureDocumentsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + documents_ = + new java.util.ArrayList(documents_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Document, + com.google.cloud.discoveryengine.v1alpha.Document.Builder, + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder> + documentsBuilder_; + + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + public java.util.List getDocumentsList() { + if (documentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(documents_); + } else { + return documentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + public int getDocumentsCount() { + if (documentsBuilder_ == null) { + return documents_.size(); + } else { + return documentsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + public com.google.cloud.discoveryengine.v1alpha.Document getDocuments(int index) { + if (documentsBuilder_ == null) { + return documents_.get(index); + } else { + return documentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + public Builder setDocuments( + int index, com.google.cloud.discoveryengine.v1alpha.Document value) { + if (documentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentsIsMutable(); + documents_.set(index, value); + onChanged(); + } else { + documentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + public Builder setDocuments( + int index, com.google.cloud.discoveryengine.v1alpha.Document.Builder builderForValue) { + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + documents_.set(index, builderForValue.build()); + onChanged(); + } else { + documentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + public Builder addDocuments(com.google.cloud.discoveryengine.v1alpha.Document value) { + if (documentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentsIsMutable(); + documents_.add(value); + onChanged(); + } else { + documentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + public Builder addDocuments( + int index, com.google.cloud.discoveryengine.v1alpha.Document value) { + if (documentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentsIsMutable(); + documents_.add(index, value); + onChanged(); + } else { + documentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + public Builder addDocuments( + com.google.cloud.discoveryengine.v1alpha.Document.Builder builderForValue) { + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + documents_.add(builderForValue.build()); + onChanged(); + } else { + documentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + public Builder addDocuments( + int index, com.google.cloud.discoveryengine.v1alpha.Document.Builder builderForValue) { + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + documents_.add(index, builderForValue.build()); + onChanged(); + } else { + documentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + public Builder addAllDocuments( + java.lang.Iterable values) { + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, documents_); + onChanged(); + } else { + documentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + public Builder clearDocuments() { + if (documentsBuilder_ == null) { + documents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + documentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + public Builder removeDocuments(int index) { + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + documents_.remove(index); + onChanged(); + } else { + documentsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + public com.google.cloud.discoveryengine.v1alpha.Document.Builder getDocumentsBuilder( + int index) { + return getDocumentsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + public com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder getDocumentsOrBuilder( + int index) { + if (documentsBuilder_ == null) { + return documents_.get(index); + } else { + return documentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + public java.util.List + getDocumentsOrBuilderList() { + if (documentsBuilder_ != null) { + return documentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(documents_); + } + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + public com.google.cloud.discoveryengine.v1alpha.Document.Builder addDocumentsBuilder() { + return getDocumentsFieldBuilder() + .addBuilder(com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance()); + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + public com.google.cloud.discoveryengine.v1alpha.Document.Builder addDocumentsBuilder( + int index) { + return getDocumentsFieldBuilder() + .addBuilder( + index, com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance()); + } + /** + * + * + *
+     * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + public java.util.List + getDocumentsBuilderList() { + return getDocumentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Document, + com.google.cloud.discoveryengine.v1alpha.Document.Builder, + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder> + getDocumentsFieldBuilder() { + if (documentsBuilder_ == null) { + documentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Document, + com.google.cloud.discoveryengine.v1alpha.Document.Builder, + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder>( + documents_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + documents_ = null; + } + return documentsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token that can be sent as
+     * [ListDocumentsRequest.page_token][google.cloud.discoveryengine.v1alpha.ListDocumentsRequest.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
+     * [ListDocumentsRequest.page_token][google.cloud.discoveryengine.v1alpha.ListDocumentsRequest.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
+     * [ListDocumentsRequest.page_token][google.cloud.discoveryengine.v1alpha.ListDocumentsRequest.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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListDocumentsRequest.page_token][google.cloud.discoveryengine.v1alpha.ListDocumentsRequest.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(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListDocumentsRequest.page_token][google.cloud.discoveryengine.v1alpha.ListDocumentsRequest.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; + bitField0_ |= 0x00000002; + 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.discoveryengine.v1alpha.ListDocumentsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.ListDocumentsResponse) + private static final com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse(); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDocumentsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListDocumentsResponseOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListDocumentsResponseOrBuilder.java new file mode 100644 index 000000000000..dd0638a339af --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListDocumentsResponseOrBuilder.java @@ -0,0 +1,108 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/document_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface ListDocumentsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.ListDocumentsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + java.util.List getDocumentsList(); + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + com.google.cloud.discoveryengine.v1alpha.Document getDocuments(int index); + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + int getDocumentsCount(); + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + java.util.List + getDocumentsOrBuilderList(); + /** + * + * + *
+   * The [Document][google.cloud.discoveryengine.v1alpha.Document]s.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Document documents = 1; + */ + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder getDocumentsOrBuilder(int index); + + /** + * + * + *
+   * A token that can be sent as
+   * [ListDocumentsRequest.page_token][google.cloud.discoveryengine.v1alpha.ListDocumentsRequest.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
+   * [ListDocumentsRequest.page_token][google.cloud.discoveryengine.v1alpha.ListDocumentsRequest.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/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListSchemasRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListSchemasRequest.java new file mode 100644 index 000000000000..ba5c2eb40d48 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListSchemasRequest.java @@ -0,0 +1,995 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request message for
+ * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ListSchemasRequest} + */ +public final class ListSchemasRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.ListSchemasRequest) + ListSchemasRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSchemasRequest.newBuilder() to construct. + private ListSchemasRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSchemasRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSchemasRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListSchemasRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListSchemasRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest.class, + com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent data store resource name, in the format of
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+   * 
+ * + * + * 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 data store resource name, in the format of
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+   * 
+ * + * + * 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_ = 0; + /** + * + * + *
+   * The maximum number of
+   * [Schema][google.cloud.discoveryengine.v1alpha.Schema]s to return. The
+   * service may return fewer than this value.
+   *
+   * If unspecified, at most 100
+   * [Schema][google.cloud.discoveryengine.v1alpha.Schema]s will be returned.
+   *
+   * The maximum value is 1000; values above 1000 will be coerced to 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A page token, received from a previous
+   * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas]
+   * call. Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to
+   * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas]
+   * must match the call that provided the page token.
+   * 
+ * + * 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, received from a previous
+   * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas]
+   * call. Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to
+   * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas]
+   * must match the call that provided the page token.
+   * 
+ * + * 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_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest other = + (com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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
+   * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ListSchemasRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.ListSchemasRequest) + com.google.cloud.discoveryengine.v1alpha.ListSchemasRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListSchemasRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListSchemasRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest.class, + com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListSchemasRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest build() { + com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest result = + new com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest other) { + if (other == com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent data store resource name, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+     * 
+ * + * + * 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 data store resource name, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+     * 
+ * + * + * 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 data store resource name, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent data store resource name, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent data store resource name, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of
+     * [Schema][google.cloud.discoveryengine.v1alpha.Schema]s to return. The
+     * service may return fewer than this value.
+     *
+     * If unspecified, at most 100
+     * [Schema][google.cloud.discoveryengine.v1alpha.Schema]s will be returned.
+     *
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of
+     * [Schema][google.cloud.discoveryengine.v1alpha.Schema]s to return. The
+     * service may return fewer than this value.
+     *
+     * If unspecified, at most 100
+     * [Schema][google.cloud.discoveryengine.v1alpha.Schema]s will be returned.
+     *
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of
+     * [Schema][google.cloud.discoveryengine.v1alpha.Schema]s to return. The
+     * service may return fewer than this value.
+     *
+     * If unspecified, at most 100
+     * [Schema][google.cloud.discoveryengine.v1alpha.Schema]s will be returned.
+     *
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token, received from a previous
+     * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas]
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas]
+     * must match the call that provided the page token.
+     * 
+ * + * 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, received from a previous
+     * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas]
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas]
+     * must match the call that provided the page token.
+     * 
+ * + * 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, received from a previous
+     * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas]
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas]
+     * must match the call that provided the page token.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous
+     * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas]
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas]
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous
+     * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas]
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas]
+     * must match the call that provided the page token.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.ListSchemasRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.ListSchemasRequest) + private static final com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSchemasRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListSchemasRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListSchemasRequestOrBuilder.java new file mode 100644 index 000000000000..2234c9b10414 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListSchemasRequestOrBuilder.java @@ -0,0 +1,113 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface ListSchemasRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.ListSchemasRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent data store resource name, in the format of
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent data store resource name, in the format of
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of
+   * [Schema][google.cloud.discoveryengine.v1alpha.Schema]s to return. The
+   * service may return fewer than this value.
+   *
+   * If unspecified, at most 100
+   * [Schema][google.cloud.discoveryengine.v1alpha.Schema]s will be returned.
+   *
+   * The maximum value is 1000; values above 1000 will be coerced to 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous
+   * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas]
+   * call. Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to
+   * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas]
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token, received from a previous
+   * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas]
+   * call. Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to
+   * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas]
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListSchemasResponse.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListSchemasResponse.java new file mode 100644 index 000000000000..5bec51f7667d --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListSchemasResponse.java @@ -0,0 +1,1150 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Response message for
+ * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ListSchemasResponse} + */ +public final class ListSchemasResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.ListSchemasResponse) + ListSchemasResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSchemasResponse.newBuilder() to construct. + private ListSchemasResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSchemasResponse() { + schemas_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSchemasResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListSchemasResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListSchemasResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse.class, + com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse.Builder.class); + } + + public static final int SCHEMAS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List schemas_; + /** + * + * + *
+   * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + @java.lang.Override + public java.util.List getSchemasList() { + return schemas_; + } + /** + * + * + *
+   * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + @java.lang.Override + public java.util.List + getSchemasOrBuilderList() { + return schemas_; + } + /** + * + * + *
+   * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + @java.lang.Override + public int getSchemasCount() { + return schemas_.size(); + } + /** + * + * + *
+   * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Schema getSchemas(int index) { + return schemas_.get(index); + } + /** + * + * + *
+   * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SchemaOrBuilder getSchemasOrBuilder(int index) { + return schemas_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token that can be sent as
+   * [ListSchemasRequest.page_token][google.cloud.discoveryengine.v1alpha.ListSchemasRequest.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
+   * [ListSchemasRequest.page_token][google.cloud.discoveryengine.v1alpha.ListSchemasRequest.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 < schemas_.size(); i++) { + output.writeMessage(1, schemas_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < schemas_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, schemas_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse other = + (com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse) obj; + + if (!getSchemasList().equals(other.getSchemasList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSchemasCount() > 0) { + hash = (37 * hash) + SCHEMAS_FIELD_NUMBER; + hash = (53 * hash) + getSchemasList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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
+   * [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.ListSchemasResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.ListSchemasResponse) + com.google.cloud.discoveryengine.v1alpha.ListSchemasResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListSchemasResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListSchemasResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse.class, + com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (schemasBuilder_ == null) { + schemas_ = java.util.Collections.emptyList(); + } else { + schemas_ = null; + schemasBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_ListSchemasResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse build() { + com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse buildPartial() { + com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse result = + new com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse result) { + if (schemasBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + schemas_ = java.util.Collections.unmodifiableList(schemas_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.schemas_ = schemas_; + } else { + result.schemas_ = schemasBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse.getDefaultInstance()) + return this; + if (schemasBuilder_ == null) { + if (!other.schemas_.isEmpty()) { + if (schemas_.isEmpty()) { + schemas_ = other.schemas_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSchemasIsMutable(); + schemas_.addAll(other.schemas_); + } + onChanged(); + } + } else { + if (!other.schemas_.isEmpty()) { + if (schemasBuilder_.isEmpty()) { + schemasBuilder_.dispose(); + schemasBuilder_ = null; + schemas_ = other.schemas_; + bitField0_ = (bitField0_ & ~0x00000001); + schemasBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSchemasFieldBuilder() + : null; + } else { + schemasBuilder_.addAllMessages(other.schemas_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.discoveryengine.v1alpha.Schema m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.Schema.parser(), + extensionRegistry); + if (schemasBuilder_ == null) { + ensureSchemasIsMutable(); + schemas_.add(m); + } else { + schemasBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List schemas_ = + java.util.Collections.emptyList(); + + private void ensureSchemasIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + schemas_ = + new java.util.ArrayList(schemas_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Schema, + com.google.cloud.discoveryengine.v1alpha.Schema.Builder, + com.google.cloud.discoveryengine.v1alpha.SchemaOrBuilder> + schemasBuilder_; + + /** + * + * + *
+     * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + public java.util.List getSchemasList() { + if (schemasBuilder_ == null) { + return java.util.Collections.unmodifiableList(schemas_); + } else { + return schemasBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + public int getSchemasCount() { + if (schemasBuilder_ == null) { + return schemas_.size(); + } else { + return schemasBuilder_.getCount(); + } + } + /** + * + * + *
+     * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + public com.google.cloud.discoveryengine.v1alpha.Schema getSchemas(int index) { + if (schemasBuilder_ == null) { + return schemas_.get(index); + } else { + return schemasBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + public Builder setSchemas(int index, com.google.cloud.discoveryengine.v1alpha.Schema value) { + if (schemasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSchemasIsMutable(); + schemas_.set(index, value); + onChanged(); + } else { + schemasBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + public Builder setSchemas( + int index, com.google.cloud.discoveryengine.v1alpha.Schema.Builder builderForValue) { + if (schemasBuilder_ == null) { + ensureSchemasIsMutable(); + schemas_.set(index, builderForValue.build()); + onChanged(); + } else { + schemasBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + public Builder addSchemas(com.google.cloud.discoveryengine.v1alpha.Schema value) { + if (schemasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSchemasIsMutable(); + schemas_.add(value); + onChanged(); + } else { + schemasBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + public Builder addSchemas(int index, com.google.cloud.discoveryengine.v1alpha.Schema value) { + if (schemasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSchemasIsMutable(); + schemas_.add(index, value); + onChanged(); + } else { + schemasBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + public Builder addSchemas( + com.google.cloud.discoveryengine.v1alpha.Schema.Builder builderForValue) { + if (schemasBuilder_ == null) { + ensureSchemasIsMutable(); + schemas_.add(builderForValue.build()); + onChanged(); + } else { + schemasBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + public Builder addSchemas( + int index, com.google.cloud.discoveryengine.v1alpha.Schema.Builder builderForValue) { + if (schemasBuilder_ == null) { + ensureSchemasIsMutable(); + schemas_.add(index, builderForValue.build()); + onChanged(); + } else { + schemasBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + public Builder addAllSchemas( + java.lang.Iterable values) { + if (schemasBuilder_ == null) { + ensureSchemasIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, schemas_); + onChanged(); + } else { + schemasBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + public Builder clearSchemas() { + if (schemasBuilder_ == null) { + schemas_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + schemasBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + public Builder removeSchemas(int index) { + if (schemasBuilder_ == null) { + ensureSchemasIsMutable(); + schemas_.remove(index); + onChanged(); + } else { + schemasBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + public com.google.cloud.discoveryengine.v1alpha.Schema.Builder getSchemasBuilder(int index) { + return getSchemasFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + public com.google.cloud.discoveryengine.v1alpha.SchemaOrBuilder getSchemasOrBuilder(int index) { + if (schemasBuilder_ == null) { + return schemas_.get(index); + } else { + return schemasBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + public java.util.List + getSchemasOrBuilderList() { + if (schemasBuilder_ != null) { + return schemasBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(schemas_); + } + } + /** + * + * + *
+     * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + public com.google.cloud.discoveryengine.v1alpha.Schema.Builder addSchemasBuilder() { + return getSchemasFieldBuilder() + .addBuilder(com.google.cloud.discoveryengine.v1alpha.Schema.getDefaultInstance()); + } + /** + * + * + *
+     * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + public com.google.cloud.discoveryengine.v1alpha.Schema.Builder addSchemasBuilder(int index) { + return getSchemasFieldBuilder() + .addBuilder(index, com.google.cloud.discoveryengine.v1alpha.Schema.getDefaultInstance()); + } + /** + * + * + *
+     * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + public java.util.List + getSchemasBuilderList() { + return getSchemasFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Schema, + com.google.cloud.discoveryengine.v1alpha.Schema.Builder, + com.google.cloud.discoveryengine.v1alpha.SchemaOrBuilder> + getSchemasFieldBuilder() { + if (schemasBuilder_ == null) { + schemasBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Schema, + com.google.cloud.discoveryengine.v1alpha.Schema.Builder, + com.google.cloud.discoveryengine.v1alpha.SchemaOrBuilder>( + schemas_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + schemas_ = null; + } + return schemasBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token that can be sent as
+     * [ListSchemasRequest.page_token][google.cloud.discoveryengine.v1alpha.ListSchemasRequest.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
+     * [ListSchemasRequest.page_token][google.cloud.discoveryengine.v1alpha.ListSchemasRequest.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
+     * [ListSchemasRequest.page_token][google.cloud.discoveryengine.v1alpha.ListSchemasRequest.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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListSchemasRequest.page_token][google.cloud.discoveryengine.v1alpha.ListSchemasRequest.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(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token that can be sent as
+     * [ListSchemasRequest.page_token][google.cloud.discoveryengine.v1alpha.ListSchemasRequest.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; + bitField0_ |= 0x00000002; + 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.discoveryengine.v1alpha.ListSchemasResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.ListSchemasResponse) + private static final com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse(); + } + + public static com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSchemasResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListSchemasResponseOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListSchemasResponseOrBuilder.java new file mode 100644 index 000000000000..eeeea2839dd9 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ListSchemasResponseOrBuilder.java @@ -0,0 +1,108 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface ListSchemasResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.ListSchemasResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + java.util.List getSchemasList(); + /** + * + * + *
+   * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + com.google.cloud.discoveryengine.v1alpha.Schema getSchemas(int index); + /** + * + * + *
+   * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + int getSchemasCount(); + /** + * + * + *
+   * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + java.util.List + getSchemasOrBuilderList(); + /** + * + * + *
+   * The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.Schema schemas = 1; + */ + com.google.cloud.discoveryengine.v1alpha.SchemaOrBuilder getSchemasOrBuilder(int index); + + /** + * + * + *
+   * A token that can be sent as
+   * [ListSchemasRequest.page_token][google.cloud.discoveryengine.v1alpha.ListSchemasRequest.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
+   * [ListSchemasRequest.page_token][google.cloud.discoveryengine.v1alpha.ListSchemasRequest.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/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/MediaInfo.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/MediaInfo.java new file mode 100644 index 000000000000..a496609163a9 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/MediaInfo.java @@ -0,0 +1,933 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/user_event.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Media-specific user event information.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.MediaInfo} + */ +public final class MediaInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.MediaInfo) + MediaInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use MediaInfo.newBuilder() to construct. + private MediaInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MediaInfo() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MediaInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_MediaInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_MediaInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.MediaInfo.class, + com.google.cloud.discoveryengine.v1alpha.MediaInfo.Builder.class); + } + + private int bitField0_; + public static final int MEDIA_PROGRESS_DURATION_FIELD_NUMBER = 1; + private com.google.protobuf.Duration mediaProgressDuration_; + /** + * + * + *
+   * The media progress time in seconds, if applicable.
+   * For example, if the end user has finished 90 seconds of a playback video,
+   * then
+   * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+   * should be set to 90.
+   * 
+ * + * .google.protobuf.Duration media_progress_duration = 1; + * + * @return Whether the mediaProgressDuration field is set. + */ + @java.lang.Override + public boolean hasMediaProgressDuration() { + return mediaProgressDuration_ != null; + } + /** + * + * + *
+   * The media progress time in seconds, if applicable.
+   * For example, if the end user has finished 90 seconds of a playback video,
+   * then
+   * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+   * should be set to 90.
+   * 
+ * + * .google.protobuf.Duration media_progress_duration = 1; + * + * @return The mediaProgressDuration. + */ + @java.lang.Override + public com.google.protobuf.Duration getMediaProgressDuration() { + return mediaProgressDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : mediaProgressDuration_; + } + /** + * + * + *
+   * The media progress time in seconds, if applicable.
+   * For example, if the end user has finished 90 seconds of a playback video,
+   * then
+   * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+   * should be set to 90.
+   * 
+ * + * .google.protobuf.Duration media_progress_duration = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getMediaProgressDurationOrBuilder() { + return mediaProgressDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : mediaProgressDuration_; + } + + public static final int MEDIA_PROGRESS_PERCENTAGE_FIELD_NUMBER = 2; + private float mediaProgressPercentage_ = 0F; + /** + * + * + *
+   * Media progress should be computed using only the
+   * [media_progress_duration][google.cloud.discoveryengine.v1alpha.MediaInfo.media_progress_duration]
+   * relative to the media total length.
+   *
+   * This value must be between `[0, 1.0]` inclusive.
+   *
+   * If this is not a playback or the progress cannot be computed (e.g. ongoing
+   * livestream), this field should be unset.
+   * 
+ * + * optional float media_progress_percentage = 2; + * + * @return Whether the mediaProgressPercentage field is set. + */ + @java.lang.Override + public boolean hasMediaProgressPercentage() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Media progress should be computed using only the
+   * [media_progress_duration][google.cloud.discoveryengine.v1alpha.MediaInfo.media_progress_duration]
+   * relative to the media total length.
+   *
+   * This value must be between `[0, 1.0]` inclusive.
+   *
+   * If this is not a playback or the progress cannot be computed (e.g. ongoing
+   * livestream), this field should be unset.
+   * 
+ * + * optional float media_progress_percentage = 2; + * + * @return The mediaProgressPercentage. + */ + @java.lang.Override + public float getMediaProgressPercentage() { + return mediaProgressPercentage_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (mediaProgressDuration_ != null) { + output.writeMessage(1, getMediaProgressDuration()); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeFloat(2, mediaProgressPercentage_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (mediaProgressDuration_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMediaProgressDuration()); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, mediaProgressPercentage_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.MediaInfo)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.MediaInfo other = + (com.google.cloud.discoveryengine.v1alpha.MediaInfo) obj; + + if (hasMediaProgressDuration() != other.hasMediaProgressDuration()) return false; + if (hasMediaProgressDuration()) { + if (!getMediaProgressDuration().equals(other.getMediaProgressDuration())) return false; + } + if (hasMediaProgressPercentage() != other.hasMediaProgressPercentage()) return false; + if (hasMediaProgressPercentage()) { + if (java.lang.Float.floatToIntBits(getMediaProgressPercentage()) + != java.lang.Float.floatToIntBits(other.getMediaProgressPercentage())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMediaProgressDuration()) { + hash = (37 * hash) + MEDIA_PROGRESS_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getMediaProgressDuration().hashCode(); + } + if (hasMediaProgressPercentage()) { + hash = (37 * hash) + MEDIA_PROGRESS_PERCENTAGE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getMediaProgressPercentage()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.MediaInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.MediaInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.MediaInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.MediaInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.MediaInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.MediaInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.MediaInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.MediaInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.MediaInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.MediaInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.MediaInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.MediaInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.discoveryengine.v1alpha.MediaInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Media-specific user event information.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.MediaInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.MediaInfo) + com.google.cloud.discoveryengine.v1alpha.MediaInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_MediaInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_MediaInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.MediaInfo.class, + com.google.cloud.discoveryengine.v1alpha.MediaInfo.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.MediaInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + mediaProgressDuration_ = null; + if (mediaProgressDurationBuilder_ != null) { + mediaProgressDurationBuilder_.dispose(); + mediaProgressDurationBuilder_ = null; + } + mediaProgressPercentage_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_MediaInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.MediaInfo getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.MediaInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.MediaInfo build() { + com.google.cloud.discoveryengine.v1alpha.MediaInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.MediaInfo buildPartial() { + com.google.cloud.discoveryengine.v1alpha.MediaInfo result = + new com.google.cloud.discoveryengine.v1alpha.MediaInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.MediaInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.mediaProgressDuration_ = + mediaProgressDurationBuilder_ == null + ? mediaProgressDuration_ + : mediaProgressDurationBuilder_.build(); + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.mediaProgressPercentage_ = mediaProgressPercentage_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.MediaInfo) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.MediaInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.MediaInfo other) { + if (other == com.google.cloud.discoveryengine.v1alpha.MediaInfo.getDefaultInstance()) + return this; + if (other.hasMediaProgressDuration()) { + mergeMediaProgressDuration(other.getMediaProgressDuration()); + } + if (other.hasMediaProgressPercentage()) { + setMediaProgressPercentage(other.getMediaProgressPercentage()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getMediaProgressDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 21: + { + mediaProgressPercentage_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Duration mediaProgressDuration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + mediaProgressDurationBuilder_; + /** + * + * + *
+     * The media progress time in seconds, if applicable.
+     * For example, if the end user has finished 90 seconds of a playback video,
+     * then
+     * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+     * should be set to 90.
+     * 
+ * + * .google.protobuf.Duration media_progress_duration = 1; + * + * @return Whether the mediaProgressDuration field is set. + */ + public boolean hasMediaProgressDuration() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The media progress time in seconds, if applicable.
+     * For example, if the end user has finished 90 seconds of a playback video,
+     * then
+     * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+     * should be set to 90.
+     * 
+ * + * .google.protobuf.Duration media_progress_duration = 1; + * + * @return The mediaProgressDuration. + */ + public com.google.protobuf.Duration getMediaProgressDuration() { + if (mediaProgressDurationBuilder_ == null) { + return mediaProgressDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : mediaProgressDuration_; + } else { + return mediaProgressDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The media progress time in seconds, if applicable.
+     * For example, if the end user has finished 90 seconds of a playback video,
+     * then
+     * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+     * should be set to 90.
+     * 
+ * + * .google.protobuf.Duration media_progress_duration = 1; + */ + public Builder setMediaProgressDuration(com.google.protobuf.Duration value) { + if (mediaProgressDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mediaProgressDuration_ = value; + } else { + mediaProgressDurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The media progress time in seconds, if applicable.
+     * For example, if the end user has finished 90 seconds of a playback video,
+     * then
+     * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+     * should be set to 90.
+     * 
+ * + * .google.protobuf.Duration media_progress_duration = 1; + */ + public Builder setMediaProgressDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (mediaProgressDurationBuilder_ == null) { + mediaProgressDuration_ = builderForValue.build(); + } else { + mediaProgressDurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The media progress time in seconds, if applicable.
+     * For example, if the end user has finished 90 seconds of a playback video,
+     * then
+     * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+     * should be set to 90.
+     * 
+ * + * .google.protobuf.Duration media_progress_duration = 1; + */ + public Builder mergeMediaProgressDuration(com.google.protobuf.Duration value) { + if (mediaProgressDurationBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && mediaProgressDuration_ != null + && mediaProgressDuration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getMediaProgressDurationBuilder().mergeFrom(value); + } else { + mediaProgressDuration_ = value; + } + } else { + mediaProgressDurationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The media progress time in seconds, if applicable.
+     * For example, if the end user has finished 90 seconds of a playback video,
+     * then
+     * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+     * should be set to 90.
+     * 
+ * + * .google.protobuf.Duration media_progress_duration = 1; + */ + public Builder clearMediaProgressDuration() { + bitField0_ = (bitField0_ & ~0x00000001); + mediaProgressDuration_ = null; + if (mediaProgressDurationBuilder_ != null) { + mediaProgressDurationBuilder_.dispose(); + mediaProgressDurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The media progress time in seconds, if applicable.
+     * For example, if the end user has finished 90 seconds of a playback video,
+     * then
+     * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+     * should be set to 90.
+     * 
+ * + * .google.protobuf.Duration media_progress_duration = 1; + */ + public com.google.protobuf.Duration.Builder getMediaProgressDurationBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getMediaProgressDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The media progress time in seconds, if applicable.
+     * For example, if the end user has finished 90 seconds of a playback video,
+     * then
+     * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+     * should be set to 90.
+     * 
+ * + * .google.protobuf.Duration media_progress_duration = 1; + */ + public com.google.protobuf.DurationOrBuilder getMediaProgressDurationOrBuilder() { + if (mediaProgressDurationBuilder_ != null) { + return mediaProgressDurationBuilder_.getMessageOrBuilder(); + } else { + return mediaProgressDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : mediaProgressDuration_; + } + } + /** + * + * + *
+     * The media progress time in seconds, if applicable.
+     * For example, if the end user has finished 90 seconds of a playback video,
+     * then
+     * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+     * should be set to 90.
+     * 
+ * + * .google.protobuf.Duration media_progress_duration = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getMediaProgressDurationFieldBuilder() { + if (mediaProgressDurationBuilder_ == null) { + mediaProgressDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getMediaProgressDuration(), getParentForChildren(), isClean()); + mediaProgressDuration_ = null; + } + return mediaProgressDurationBuilder_; + } + + private float mediaProgressPercentage_; + /** + * + * + *
+     * Media progress should be computed using only the
+     * [media_progress_duration][google.cloud.discoveryengine.v1alpha.MediaInfo.media_progress_duration]
+     * relative to the media total length.
+     *
+     * This value must be between `[0, 1.0]` inclusive.
+     *
+     * If this is not a playback or the progress cannot be computed (e.g. ongoing
+     * livestream), this field should be unset.
+     * 
+ * + * optional float media_progress_percentage = 2; + * + * @return Whether the mediaProgressPercentage field is set. + */ + @java.lang.Override + public boolean hasMediaProgressPercentage() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Media progress should be computed using only the
+     * [media_progress_duration][google.cloud.discoveryengine.v1alpha.MediaInfo.media_progress_duration]
+     * relative to the media total length.
+     *
+     * This value must be between `[0, 1.0]` inclusive.
+     *
+     * If this is not a playback or the progress cannot be computed (e.g. ongoing
+     * livestream), this field should be unset.
+     * 
+ * + * optional float media_progress_percentage = 2; + * + * @return The mediaProgressPercentage. + */ + @java.lang.Override + public float getMediaProgressPercentage() { + return mediaProgressPercentage_; + } + /** + * + * + *
+     * Media progress should be computed using only the
+     * [media_progress_duration][google.cloud.discoveryengine.v1alpha.MediaInfo.media_progress_duration]
+     * relative to the media total length.
+     *
+     * This value must be between `[0, 1.0]` inclusive.
+     *
+     * If this is not a playback or the progress cannot be computed (e.g. ongoing
+     * livestream), this field should be unset.
+     * 
+ * + * optional float media_progress_percentage = 2; + * + * @param value The mediaProgressPercentage to set. + * @return This builder for chaining. + */ + public Builder setMediaProgressPercentage(float value) { + + mediaProgressPercentage_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Media progress should be computed using only the
+     * [media_progress_duration][google.cloud.discoveryengine.v1alpha.MediaInfo.media_progress_duration]
+     * relative to the media total length.
+     *
+     * This value must be between `[0, 1.0]` inclusive.
+     *
+     * If this is not a playback or the progress cannot be computed (e.g. ongoing
+     * livestream), this field should be unset.
+     * 
+ * + * optional float media_progress_percentage = 2; + * + * @return This builder for chaining. + */ + public Builder clearMediaProgressPercentage() { + bitField0_ = (bitField0_ & ~0x00000002); + mediaProgressPercentage_ = 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.discoveryengine.v1alpha.MediaInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.MediaInfo) + private static final com.google.cloud.discoveryengine.v1alpha.MediaInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.MediaInfo(); + } + + public static com.google.cloud.discoveryengine.v1alpha.MediaInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MediaInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.MediaInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/MediaInfoOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/MediaInfoOrBuilder.java new file mode 100644 index 000000000000..da95be08091a --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/MediaInfoOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/user_event.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface MediaInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.MediaInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The media progress time in seconds, if applicable.
+   * For example, if the end user has finished 90 seconds of a playback video,
+   * then
+   * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+   * should be set to 90.
+   * 
+ * + * .google.protobuf.Duration media_progress_duration = 1; + * + * @return Whether the mediaProgressDuration field is set. + */ + boolean hasMediaProgressDuration(); + /** + * + * + *
+   * The media progress time in seconds, if applicable.
+   * For example, if the end user has finished 90 seconds of a playback video,
+   * then
+   * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+   * should be set to 90.
+   * 
+ * + * .google.protobuf.Duration media_progress_duration = 1; + * + * @return The mediaProgressDuration. + */ + com.google.protobuf.Duration getMediaProgressDuration(); + /** + * + * + *
+   * The media progress time in seconds, if applicable.
+   * For example, if the end user has finished 90 seconds of a playback video,
+   * then
+   * [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
+   * should be set to 90.
+   * 
+ * + * .google.protobuf.Duration media_progress_duration = 1; + */ + com.google.protobuf.DurationOrBuilder getMediaProgressDurationOrBuilder(); + + /** + * + * + *
+   * Media progress should be computed using only the
+   * [media_progress_duration][google.cloud.discoveryengine.v1alpha.MediaInfo.media_progress_duration]
+   * relative to the media total length.
+   *
+   * This value must be between `[0, 1.0]` inclusive.
+   *
+   * If this is not a playback or the progress cannot be computed (e.g. ongoing
+   * livestream), this field should be unset.
+   * 
+ * + * optional float media_progress_percentage = 2; + * + * @return Whether the mediaProgressPercentage field is set. + */ + boolean hasMediaProgressPercentage(); + /** + * + * + *
+   * Media progress should be computed using only the
+   * [media_progress_duration][google.cloud.discoveryengine.v1alpha.MediaInfo.media_progress_duration]
+   * relative to the media total length.
+   *
+   * This value must be between `[0, 1.0]` inclusive.
+   *
+   * If this is not a playback or the progress cannot be computed (e.g. ongoing
+   * livestream), this field should be unset.
+   * 
+ * + * optional float media_progress_percentage = 2; + * + * @return The mediaProgressPercentage. + */ + float getMediaProgressPercentage(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PageInfo.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PageInfo.java new file mode 100644 index 000000000000..0aa9868ee18b --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PageInfo.java @@ -0,0 +1,1366 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/user_event.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Detailed page information.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.PageInfo} + */ +public final class PageInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.PageInfo) + PageInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use PageInfo.newBuilder() to construct. + private PageInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PageInfo() { + pageviewId_ = ""; + pageCategory_ = ""; + uri_ = ""; + referrerUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PageInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_PageInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_PageInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.PageInfo.class, + com.google.cloud.discoveryengine.v1alpha.PageInfo.Builder.class); + } + + public static final int PAGEVIEW_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + 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 `pageview_id` 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 pageview_id = 1; + * + * @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 `pageview_id` 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 pageview_id = 1; + * + * @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; + } + } + + public static final int PAGE_CATEGORY_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageCategory_ = ""; + /** + * + * + *
+   * The most specific category 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:
+   * `"pageCategory" : "Sales > 2017 Black Friday Deals"`.
+   *
+   * Required for `view-category-page` events. Other event types should not set
+   * this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
+   * 
+ * + * string page_category = 2; + * + * @return The pageCategory. + */ + @java.lang.Override + public java.lang.String getPageCategory() { + java.lang.Object ref = pageCategory_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageCategory_ = s; + return s; + } + } + /** + * + * + *
+   * The most specific category 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:
+   * `"pageCategory" : "Sales > 2017 Black Friday Deals"`.
+   *
+   * Required for `view-category-page` events. Other event types should not set
+   * this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
+   * 
+ * + * string page_category = 2; + * + * @return The bytes for pageCategory. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageCategoryBytes() { + java.lang.Object ref = pageCategory_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageCategory_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int URI_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + 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 = 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; + } + } + /** + * + * + *
+   * 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 = 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 REFERRER_URI_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + 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. However, some browser
+   * privacy restrictions may cause this field to be empty.
+   * 
+ * + * string referrer_uri = 4; + * + * @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. However, some browser
+   * privacy restrictions may cause this field to be empty.
+   * 
+ * + * string referrer_uri = 4; + * + * @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; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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(pageviewId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pageviewId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageCategory_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageCategory_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referrerUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, referrerUri_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageviewId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, pageviewId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageCategory_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageCategory_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referrerUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, referrerUri_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.PageInfo)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.PageInfo other = + (com.google.cloud.discoveryengine.v1alpha.PageInfo) obj; + + if (!getPageviewId().equals(other.getPageviewId())) return false; + if (!getPageCategory().equals(other.getPageCategory())) return false; + if (!getUri().equals(other.getUri())) return false; + if (!getReferrerUri().equals(other.getReferrerUri())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PAGEVIEW_ID_FIELD_NUMBER; + hash = (53 * hash) + getPageviewId().hashCode(); + hash = (37 * hash) + PAGE_CATEGORY_FIELD_NUMBER; + hash = (53 * hash) + getPageCategory().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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.PageInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.PageInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PageInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.PageInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PageInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.PageInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PageInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.PageInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PageInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.PageInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PageInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.PageInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.discoveryengine.v1alpha.PageInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 page information.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.PageInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.PageInfo) + com.google.cloud.discoveryengine.v1alpha.PageInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_PageInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_PageInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.PageInfo.class, + com.google.cloud.discoveryengine.v1alpha.PageInfo.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.PageInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + pageviewId_ = ""; + pageCategory_ = ""; + uri_ = ""; + referrerUri_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_PageInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PageInfo getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.PageInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PageInfo build() { + com.google.cloud.discoveryengine.v1alpha.PageInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PageInfo buildPartial() { + com.google.cloud.discoveryengine.v1alpha.PageInfo result = + new com.google.cloud.discoveryengine.v1alpha.PageInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.PageInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.pageviewId_ = pageviewId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageCategory_ = pageCategory_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.uri_ = uri_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.referrerUri_ = referrerUri_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.PageInfo) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.PageInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.PageInfo other) { + if (other == com.google.cloud.discoveryengine.v1alpha.PageInfo.getDefaultInstance()) + return this; + if (!other.getPageviewId().isEmpty()) { + pageviewId_ = other.pageviewId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPageCategory().isEmpty()) { + pageCategory_ = other.pageCategory_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getReferrerUri().isEmpty()) { + referrerUri_ = other.referrerUri_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + pageviewId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + pageCategory_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + uri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + referrerUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object 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 `pageview_id` 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 pageview_id = 1; + * + * @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 `pageview_id` 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 pageview_id = 1; + * + * @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 `pageview_id` 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 pageview_id = 1; + * + * @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; + bitField0_ |= 0x00000001; + 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 `pageview_id` 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 pageview_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearPageviewId() { + pageviewId_ = getDefaultInstance().getPageviewId(); + bitField0_ = (bitField0_ & ~0x00000001); + 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 `pageview_id` 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 pageview_id = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object pageCategory_ = ""; + /** + * + * + *
+     * The most specific category 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:
+     * `"pageCategory" : "Sales > 2017 Black Friday Deals"`.
+     *
+     * Required for `view-category-page` events. Other event types should not set
+     * this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
+     * 
+ * + * string page_category = 2; + * + * @return The pageCategory. + */ + public java.lang.String getPageCategory() { + java.lang.Object ref = pageCategory_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageCategory_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The most specific category 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:
+     * `"pageCategory" : "Sales > 2017 Black Friday Deals"`.
+     *
+     * Required for `view-category-page` events. Other event types should not set
+     * this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
+     * 
+ * + * string page_category = 2; + * + * @return The bytes for pageCategory. + */ + public com.google.protobuf.ByteString getPageCategoryBytes() { + java.lang.Object ref = pageCategory_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageCategory_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The most specific category 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:
+     * `"pageCategory" : "Sales > 2017 Black Friday Deals"`.
+     *
+     * Required for `view-category-page` events. Other event types should not set
+     * this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
+     * 
+ * + * string page_category = 2; + * + * @param value The pageCategory to set. + * @return This builder for chaining. + */ + public Builder setPageCategory(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageCategory_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The most specific category 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:
+     * `"pageCategory" : "Sales > 2017 Black Friday Deals"`.
+     *
+     * Required for `view-category-page` events. Other event types should not set
+     * this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
+     * 
+ * + * string page_category = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageCategory() { + pageCategory_ = getDefaultInstance().getPageCategory(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The most specific category 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:
+     * `"pageCategory" : "Sales > 2017 Black Friday Deals"`.
+     *
+     * Required for `view-category-page` events. Other event types should not set
+     * this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
+     * 
+ * + * string page_category = 2; + * + * @param value The bytes for pageCategory to set. + * @return This builder for chaining. + */ + public Builder setPageCategoryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageCategory_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + 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 = 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; + } + } + /** + * + * + *
+     * 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 = 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; + } + } + /** + * + * + *
+     * 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 = 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; + bitField0_ |= 0x00000004; + 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 = 3; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + uri_ = getDefaultInstance().getUri(); + bitField0_ = (bitField0_ & ~0x00000004); + 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 = 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; + bitField0_ |= 0x00000004; + 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. However, some browser
+     * privacy restrictions may cause this field to be empty.
+     * 
+ * + * string referrer_uri = 4; + * + * @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. However, some browser
+     * privacy restrictions may cause this field to be empty.
+     * 
+ * + * string referrer_uri = 4; + * + * @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. However, some browser
+     * privacy restrictions may cause this field to be empty.
+     * 
+ * + * string referrer_uri = 4; + * + * @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; + bitField0_ |= 0x00000008; + 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. However, some browser
+     * privacy restrictions may cause this field to be empty.
+     * 
+ * + * string referrer_uri = 4; + * + * @return This builder for chaining. + */ + public Builder clearReferrerUri() { + referrerUri_ = getDefaultInstance().getReferrerUri(); + bitField0_ = (bitField0_ & ~0x00000008); + 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. However, some browser
+     * privacy restrictions may cause this field to be empty.
+     * 
+ * + * string referrer_uri = 4; + * + * @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; + bitField0_ |= 0x00000008; + 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.discoveryengine.v1alpha.PageInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.PageInfo) + private static final com.google.cloud.discoveryengine.v1alpha.PageInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.PageInfo(); + } + + public static com.google.cloud.discoveryengine.v1alpha.PageInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PageInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PageInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PageInfoOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PageInfoOrBuilder.java new file mode 100644 index 000000000000..4ff7d9ac8ac6 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PageInfoOrBuilder.java @@ -0,0 +1,181 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/user_event.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface PageInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.PageInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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 `pageview_id` 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 pageview_id = 1; + * + * @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 `pageview_id` 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 pageview_id = 1; + * + * @return The bytes for pageviewId. + */ + com.google.protobuf.ByteString getPageviewIdBytes(); + + /** + * + * + *
+   * The most specific category 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:
+   * `"pageCategory" : "Sales > 2017 Black Friday Deals"`.
+   *
+   * Required for `view-category-page` events. Other event types should not set
+   * this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
+   * 
+ * + * string page_category = 2; + * + * @return The pageCategory. + */ + java.lang.String getPageCategory(); + /** + * + * + *
+   * The most specific category 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:
+   * `"pageCategory" : "Sales > 2017 Black Friday Deals"`.
+   *
+   * Required for `view-category-page` events. Other event types should not set
+   * this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
+   * 
+ * + * string page_category = 2; + * + * @return The bytes for pageCategory. + */ + com.google.protobuf.ByteString getPageCategoryBytes(); + + /** + * + * + *
+   * 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 = 3; + * + * @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 = 3; + * + * @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. However, some browser
+   * privacy restrictions may cause this field to be empty.
+   * 
+ * + * string referrer_uri = 4; + * + * @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. However, some browser
+   * privacy restrictions may cause this field to be empty.
+   * 
+ * + * string referrer_uri = 4; + * + * @return The bytes for referrerUri. + */ + com.google.protobuf.ByteString getReferrerUriBytes(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PanelInfo.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PanelInfo.java new file mode 100644 index 000000000000..ec4b8864dd67 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PanelInfo.java @@ -0,0 +1,1103 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/user_event.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Detailed panel information associated with a user event.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.PanelInfo} + */ +public final class PanelInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.PanelInfo) + PanelInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use PanelInfo.newBuilder() to construct. + private PanelInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PanelInfo() { + panelId_ = ""; + displayName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PanelInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_PanelInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_PanelInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.PanelInfo.class, + com.google.cloud.discoveryengine.v1alpha.PanelInfo.Builder.class); + } + + private int bitField0_; + public static final int PANEL_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object panelId_ = ""; + /** + * + * + *
+   * Required. The panel ID.
+   * 
+ * + * string panel_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The panelId. + */ + @java.lang.Override + public java.lang.String getPanelId() { + java.lang.Object ref = panelId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + panelId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The panel ID.
+   * 
+ * + * string panel_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for panelId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPanelIdBytes() { + java.lang.Object ref = panelId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + panelId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * The display name of the panel.
+   * 
+ * + * string display_name = 3; + * + * @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; + } + } + /** + * + * + *
+   * The display name of the panel.
+   * 
+ * + * string display_name = 3; + * + * @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 PANEL_POSITION_FIELD_NUMBER = 4; + private int panelPosition_ = 0; + /** + * + * + *
+   * The ordered position of the panel, if shown to the user with other panels.
+   * If set, then
+   * [total_panels][google.cloud.discoveryengine.v1alpha.PanelInfo.total_panels]
+   * must also be set.
+   * 
+ * + * optional int32 panel_position = 4; + * + * @return Whether the panelPosition field is set. + */ + @java.lang.Override + public boolean hasPanelPosition() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The ordered position of the panel, if shown to the user with other panels.
+   * If set, then
+   * [total_panels][google.cloud.discoveryengine.v1alpha.PanelInfo.total_panels]
+   * must also be set.
+   * 
+ * + * optional int32 panel_position = 4; + * + * @return The panelPosition. + */ + @java.lang.Override + public int getPanelPosition() { + return panelPosition_; + } + + public static final int TOTAL_PANELS_FIELD_NUMBER = 5; + private int totalPanels_ = 0; + /** + * + * + *
+   * The total number of panels, including this one, shown to the user.
+   * Must be set if
+   * [panel_position][google.cloud.discoveryengine.v1alpha.PanelInfo.panel_position]
+   * is set.
+   * 
+ * + * optional int32 total_panels = 5; + * + * @return Whether the totalPanels field is set. + */ + @java.lang.Override + public boolean hasTotalPanels() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The total number of panels, including this one, shown to the user.
+   * Must be set if
+   * [panel_position][google.cloud.discoveryengine.v1alpha.PanelInfo.panel_position]
+   * is set.
+   * 
+ * + * optional int32 total_panels = 5; + * + * @return The totalPanels. + */ + @java.lang.Override + public int getTotalPanels() { + return totalPanels_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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(panelId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, panelId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, displayName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(4, panelPosition_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(5, totalPanels_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(panelId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, panelId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, displayName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, panelPosition_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, totalPanels_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.PanelInfo)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.PanelInfo other = + (com.google.cloud.discoveryengine.v1alpha.PanelInfo) obj; + + if (!getPanelId().equals(other.getPanelId())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (hasPanelPosition() != other.hasPanelPosition()) return false; + if (hasPanelPosition()) { + if (getPanelPosition() != other.getPanelPosition()) return false; + } + if (hasTotalPanels() != other.hasTotalPanels()) return false; + if (hasTotalPanels()) { + if (getTotalPanels() != other.getTotalPanels()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PANEL_ID_FIELD_NUMBER; + hash = (53 * hash) + getPanelId().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (hasPanelPosition()) { + hash = (37 * hash) + PANEL_POSITION_FIELD_NUMBER; + hash = (53 * hash) + getPanelPosition(); + } + if (hasTotalPanels()) { + hash = (37 * hash) + TOTAL_PANELS_FIELD_NUMBER; + hash = (53 * hash) + getTotalPanels(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.PanelInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.PanelInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PanelInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.PanelInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PanelInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.PanelInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PanelInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.PanelInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PanelInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.PanelInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PanelInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.PanelInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.discoveryengine.v1alpha.PanelInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 panel information associated with a user event.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.PanelInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.PanelInfo) + com.google.cloud.discoveryengine.v1alpha.PanelInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_PanelInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_PanelInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.PanelInfo.class, + com.google.cloud.discoveryengine.v1alpha.PanelInfo.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.PanelInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + panelId_ = ""; + displayName_ = ""; + panelPosition_ = 0; + totalPanels_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_PanelInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PanelInfo getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.PanelInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PanelInfo build() { + com.google.cloud.discoveryengine.v1alpha.PanelInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PanelInfo buildPartial() { + com.google.cloud.discoveryengine.v1alpha.PanelInfo result = + new com.google.cloud.discoveryengine.v1alpha.PanelInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.PanelInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.panelId_ = panelId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.panelPosition_ = panelPosition_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.totalPanels_ = totalPanels_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.PanelInfo) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.PanelInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.PanelInfo other) { + if (other == com.google.cloud.discoveryengine.v1alpha.PanelInfo.getDefaultInstance()) + return this; + if (!other.getPanelId().isEmpty()) { + panelId_ = other.panelId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasPanelPosition()) { + setPanelPosition(other.getPanelPosition()); + } + if (other.hasTotalPanels()) { + setTotalPanels(other.getTotalPanels()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + panelId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 18 + case 26: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 32: + { + panelPosition_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 40: + { + totalPanels_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object panelId_ = ""; + /** + * + * + *
+     * Required. The panel ID.
+     * 
+ * + * string panel_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The panelId. + */ + public java.lang.String getPanelId() { + java.lang.Object ref = panelId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + panelId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The panel ID.
+     * 
+ * + * string panel_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for panelId. + */ + public com.google.protobuf.ByteString getPanelIdBytes() { + java.lang.Object ref = panelId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + panelId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The panel ID.
+     * 
+ * + * string panel_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The panelId to set. + * @return This builder for chaining. + */ + public Builder setPanelId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + panelId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The panel ID.
+     * 
+ * + * string panel_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPanelId() { + panelId_ = getDefaultInstance().getPanelId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The panel ID.
+     * 
+ * + * string panel_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for panelId to set. + * @return This builder for chaining. + */ + public Builder setPanelIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + panelId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The display name of the panel.
+     * 
+ * + * string display_name = 3; + * + * @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; + } + } + /** + * + * + *
+     * The display name of the panel.
+     * 
+ * + * string display_name = 3; + * + * @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; + } + } + /** + * + * + *
+     * The display name of the panel.
+     * 
+ * + * string display_name = 3; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of the panel.
+     * 
+ * + * string display_name = 3; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of the panel.
+     * 
+ * + * string display_name = 3; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int panelPosition_; + /** + * + * + *
+     * The ordered position of the panel, if shown to the user with other panels.
+     * If set, then
+     * [total_panels][google.cloud.discoveryengine.v1alpha.PanelInfo.total_panels]
+     * must also be set.
+     * 
+ * + * optional int32 panel_position = 4; + * + * @return Whether the panelPosition field is set. + */ + @java.lang.Override + public boolean hasPanelPosition() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The ordered position of the panel, if shown to the user with other panels.
+     * If set, then
+     * [total_panels][google.cloud.discoveryengine.v1alpha.PanelInfo.total_panels]
+     * must also be set.
+     * 
+ * + * optional int32 panel_position = 4; + * + * @return The panelPosition. + */ + @java.lang.Override + public int getPanelPosition() { + return panelPosition_; + } + /** + * + * + *
+     * The ordered position of the panel, if shown to the user with other panels.
+     * If set, then
+     * [total_panels][google.cloud.discoveryengine.v1alpha.PanelInfo.total_panels]
+     * must also be set.
+     * 
+ * + * optional int32 panel_position = 4; + * + * @param value The panelPosition to set. + * @return This builder for chaining. + */ + public Builder setPanelPosition(int value) { + + panelPosition_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The ordered position of the panel, if shown to the user with other panels.
+     * If set, then
+     * [total_panels][google.cloud.discoveryengine.v1alpha.PanelInfo.total_panels]
+     * must also be set.
+     * 
+ * + * optional int32 panel_position = 4; + * + * @return This builder for chaining. + */ + public Builder clearPanelPosition() { + bitField0_ = (bitField0_ & ~0x00000004); + panelPosition_ = 0; + onChanged(); + return this; + } + + private int totalPanels_; + /** + * + * + *
+     * The total number of panels, including this one, shown to the user.
+     * Must be set if
+     * [panel_position][google.cloud.discoveryengine.v1alpha.PanelInfo.panel_position]
+     * is set.
+     * 
+ * + * optional int32 total_panels = 5; + * + * @return Whether the totalPanels field is set. + */ + @java.lang.Override + public boolean hasTotalPanels() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * The total number of panels, including this one, shown to the user.
+     * Must be set if
+     * [panel_position][google.cloud.discoveryengine.v1alpha.PanelInfo.panel_position]
+     * is set.
+     * 
+ * + * optional int32 total_panels = 5; + * + * @return The totalPanels. + */ + @java.lang.Override + public int getTotalPanels() { + return totalPanels_; + } + /** + * + * + *
+     * The total number of panels, including this one, shown to the user.
+     * Must be set if
+     * [panel_position][google.cloud.discoveryengine.v1alpha.PanelInfo.panel_position]
+     * is set.
+     * 
+ * + * optional int32 total_panels = 5; + * + * @param value The totalPanels to set. + * @return This builder for chaining. + */ + public Builder setTotalPanels(int value) { + + totalPanels_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The total number of panels, including this one, shown to the user.
+     * Must be set if
+     * [panel_position][google.cloud.discoveryengine.v1alpha.PanelInfo.panel_position]
+     * is set.
+     * 
+ * + * optional int32 total_panels = 5; + * + * @return This builder for chaining. + */ + public Builder clearTotalPanels() { + bitField0_ = (bitField0_ & ~0x00000008); + totalPanels_ = 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.discoveryengine.v1alpha.PanelInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.PanelInfo) + private static final com.google.cloud.discoveryengine.v1alpha.PanelInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.PanelInfo(); + } + + public static com.google.cloud.discoveryengine.v1alpha.PanelInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PanelInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PanelInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PanelInfoOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PanelInfoOrBuilder.java new file mode 100644 index 000000000000..671b6780e134 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PanelInfoOrBuilder.java @@ -0,0 +1,137 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/user_event.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface PanelInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.PanelInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The panel ID.
+   * 
+ * + * string panel_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The panelId. + */ + java.lang.String getPanelId(); + /** + * + * + *
+   * Required. The panel ID.
+   * 
+ * + * string panel_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for panelId. + */ + com.google.protobuf.ByteString getPanelIdBytes(); + + /** + * + * + *
+   * The display name of the panel.
+   * 
+ * + * string display_name = 3; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * The display name of the panel.
+   * 
+ * + * string display_name = 3; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * The ordered position of the panel, if shown to the user with other panels.
+   * If set, then
+   * [total_panels][google.cloud.discoveryengine.v1alpha.PanelInfo.total_panels]
+   * must also be set.
+   * 
+ * + * optional int32 panel_position = 4; + * + * @return Whether the panelPosition field is set. + */ + boolean hasPanelPosition(); + /** + * + * + *
+   * The ordered position of the panel, if shown to the user with other panels.
+   * If set, then
+   * [total_panels][google.cloud.discoveryengine.v1alpha.PanelInfo.total_panels]
+   * must also be set.
+   * 
+ * + * optional int32 panel_position = 4; + * + * @return The panelPosition. + */ + int getPanelPosition(); + + /** + * + * + *
+   * The total number of panels, including this one, shown to the user.
+   * Must be set if
+   * [panel_position][google.cloud.discoveryengine.v1alpha.PanelInfo.panel_position]
+   * is set.
+   * 
+ * + * optional int32 total_panels = 5; + * + * @return Whether the totalPanels field is set. + */ + boolean hasTotalPanels(); + /** + * + * + *
+   * The total number of panels, including this one, shown to the user.
+   * Must be set if
+   * [panel_position][google.cloud.discoveryengine.v1alpha.PanelInfo.panel_position]
+   * is set.
+   * 
+ * + * optional int32 total_panels = 5; + * + * @return The totalPanels. + */ + int getTotalPanels(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeConfigProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeConfigProto.java new file mode 100644 index 000000000000..680c0fe3b57c --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeConfigProto.java @@ -0,0 +1,164 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/purge_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +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_discoveryengine_v1alpha_PurgeUserEventsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsMetadata_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/discoveryengine/v1alpha/p" + + "urge_config.proto\022$google.cloud.discover" + + "yengine.v1alpha\032\037google/api/field_behavi" + + "or.proto\032\031google/api/resource.proto\032\037goo" + + "gle/protobuf/timestamp.proto\"\200\001\n\026PurgeUs" + + "erEventsRequest\022A\n\006parent\030\001 \001(\tB1\342A\001\002\372A*" + + "\n(discoveryengine.googleapis.com/DataSto" + + "re\022\024\n\006filter\030\002 \001(\tB\004\342A\001\002\022\r\n\005force\030\003 \001(\010\"" + + ".\n\027PurgeUserEventsResponse\022\023\n\013purge_coun" + + "t\030\001 \001(\003\"\251\001\n\027PurgeUserEventsMetadata\022/\n\013c" + + "reate_time\030\001 \001(\0132\032.google.protobuf.Times" + + "tamp\022/\n\013update_time\030\002 \001(\0132\032.google.proto" + + "buf.Timestamp\022\025\n\rsuccess_count\030\003 \001(\003\022\025\n\r" + + "failure_count\030\004 \001(\003\"|\n\025PurgeDocumentsReq" + + "uest\022>\n\006parent\030\001 \001(\tB.\342A\001\002\372A\'\n%discovery" + + "engine.googleapis.com/Branch\022\024\n\006filter\030\002" + + " \001(\tB\004\342A\001\002\022\r\n\005force\030\003 \001(\010\"q\n\026PurgeDocume" + + "ntsResponse\022\023\n\013purge_count\030\001 \001(\003\022B\n\014purg" + + "e_sample\030\002 \003(\tB,\372A)\n\'discoveryengine.goo" + + "gleapis.com/Document\"\250\001\n\026PurgeDocumentsM" + + "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(\003B\234\002\n(com." + + "google.cloud.discoveryengine.v1alphaB\020Pu" + + "rgeConfigProtoP\001ZRcloud.google.com/go/di" + + "scoveryengine/apiv1alpha/discoveryengine" + + "pb;discoveryenginepb\242\002\017DISCOVERYENGINE\252\002" + + "$Google.Cloud.DiscoveryEngine.V1Alpha\312\002$" + + "Google\\Cloud\\DiscoveryEngine\\V1alpha\352\002\'G" + + "oogle::Cloud::DiscoveryEngine::V1alphab\006" + + "proto3" + }; + 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_discoveryengine_v1alpha_PurgeUserEventsRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "Force", + }); + internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsResponse_descriptor, + new java.lang.String[] { + "PurgeCount", + }); + internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsMetadata_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsMetadata_descriptor, + new java.lang.String[] { + "CreateTime", "UpdateTime", "SuccessCount", "FailureCount", + }); + internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "Force", + }); + internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsResponse_descriptor, + new java.lang.String[] { + "PurgeCount", "PurgeSample", + }); + internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsMetadata_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsMetadata_descriptor, + new java.lang.String[] { + "CreateTime", "UpdateTime", "SuccessCount", "FailureCount", + }); + 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/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsMetadata.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsMetadata.java new file mode 100644 index 000000000000..4ab9f53e9516 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsMetadata.java @@ -0,0 +1,1169 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/purge_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Metadata related to the progress of the PurgeDocuments operation.
+ * This will be returned by the google.longrunning.Operation.metadata field.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata} + */ +public final class PurgeDocumentsMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata) + PurgeDocumentsMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use PurgeDocumentsMetadata.newBuilder() to construct. + private PurgeDocumentsMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PurgeDocumentsMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PurgeDocumentsMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata.class, + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata.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 createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + 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 updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int SUCCESS_COUNT_FIELD_NUMBER = 3; + private long successCount_ = 0L; + /** + * + * + *
+   * 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_ = 0L; + /** + * + * + *
+   * 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_); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata other = + (com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata) 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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 PurgeDocuments operation.
+   * This will be returned by the google.longrunning.Operation.metadata field.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata) + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata.class, + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + successCount_ = 0L; + failureCount_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata build() { + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata buildPartial() { + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata result = + new com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.successCount_ = successCount_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.failureCount_ = failureCount_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata.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.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + successCount_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + failureCount_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private 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 ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * 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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + 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(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000001); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000001; + 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 ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * 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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + 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(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + 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 (((bitField0_ & 0x00000002) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + 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() { + bitField0_ = (bitField0_ & ~0x00000002); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + 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() { + bitField0_ |= 0x00000002; + 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of entries that were deleted successfully.
+     * 
+ * + * int64 success_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearSuccessCount() { + bitField0_ = (bitField0_ & ~0x00000004); + 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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of entries that encountered errors while processing.
+     * 
+ * + * int64 failure_count = 4; + * + * @return This builder for chaining. + */ + public Builder clearFailureCount() { + bitField0_ = (bitField0_ & ~0x00000008); + 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.discoveryengine.v1alpha.PurgeDocumentsMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata) + private static final com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata(); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PurgeDocumentsMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsMetadataOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsMetadataOrBuilder.java new file mode 100644 index 000000000000..df3929cf240c --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsMetadataOrBuilder.java @@ -0,0 +1,124 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/purge_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface PurgeDocumentsMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata) + 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/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsRequest.java new file mode 100644 index 000000000000..f1b1471f12f2 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsRequest.java @@ -0,0 +1,949 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/purge_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request message for
+ * [DocumentService.PurgeDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.PurgeDocuments]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest} + */ +public final class PurgeDocumentsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest) + PurgeDocumentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use PurgeDocumentsRequest.newBuilder() to construct. + private PurgeDocumentsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PurgeDocumentsRequest() { + parent_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PurgeDocumentsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest.class, + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent resource name, such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{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 resource name, such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{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 FILTER_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Required. Filter matching documents to purge. Only currently supported
+   * value is
+   * `*` (all items).
+   * 
+ * + * 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. Filter matching documents to purge. Only currently supported
+   * value is
+   * `*` (all items).
+   * 
+ * + * 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_ = false; + /** + * + * + *
+   * Actually performs the purge. If `force` is set to false, return the
+   * expected purge count without deleting any documents.
+   * 
+ * + * 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_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest other = + (com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getForce() != other.getForce()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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
+   * [DocumentService.PurgeDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.PurgeDocuments]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest) + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest.class, + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + filter_ = ""; + force_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest build() { + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest result = + new com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.force_ = force_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getForce() != false) { + setForce(other.getForce()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + force_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{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 resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{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 resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Required. Filter matching documents to purge. Only currently supported
+     * value is
+     * `*` (all items).
+     * 
+ * + * 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. Filter matching documents to purge. Only currently supported
+     * value is
+     * `*` (all items).
+     * 
+ * + * 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. Filter matching documents to purge. Only currently supported
+     * value is
+     * `*` (all items).
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Filter matching documents to purge. Only currently supported
+     * value is
+     * `*` (all items).
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Filter matching documents to purge. Only currently supported
+     * value is
+     * `*` (all items).
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean force_; + /** + * + * + *
+     * Actually performs the purge. If `force` is set to false, return the
+     * expected purge count without deleting any documents.
+     * 
+ * + * bool force = 3; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * Actually performs the purge. If `force` is set to false, return the
+     * expected purge count without deleting any documents.
+     * 
+ * + * bool force = 3; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Actually performs the purge. If `force` is set to false, return the
+     * expected purge count without deleting any documents.
+     * 
+ * + * bool force = 3; + * + * @return This builder for chaining. + */ + public Builder clearForce() { + bitField0_ = (bitField0_ & ~0x00000004); + 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.discoveryengine.v1alpha.PurgeDocumentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest) + private static final com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PurgeDocumentsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsRequestOrBuilder.java new file mode 100644 index 000000000000..6a6b1e1c41ad --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsRequestOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/purge_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface PurgeDocumentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name, such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name, such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Filter matching documents to purge. Only currently supported
+   * value is
+   * `*` (all items).
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Required. Filter matching documents to purge. Only currently supported
+   * value is
+   * `*` (all items).
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Actually performs the purge. If `force` is set to false, return the
+   * expected purge count without deleting any documents.
+   * 
+ * + * bool force = 3; + * + * @return The force. + */ + boolean getForce(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsResponse.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsResponse.java new file mode 100644 index 000000000000..b199061372d7 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsResponse.java @@ -0,0 +1,852 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/purge_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Response message for
+ * [DocumentService.PurgeDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.PurgeDocuments]
+ * method. 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.discoveryengine.v1alpha.PurgeDocumentsResponse} + */ +public final class PurgeDocumentsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse) + PurgeDocumentsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use PurgeDocumentsResponse.newBuilder() to construct. + private PurgeDocumentsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PurgeDocumentsResponse() { + purgeSample_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PurgeDocumentsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse.class, + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse.Builder.class); + } + + public static final int PURGE_COUNT_FIELD_NUMBER = 1; + private long purgeCount_ = 0L; + /** + * + * + *
+   * The total count of documents 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; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList purgeSample_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * A sample of document 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 document 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 document 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 document 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)); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse other = + (com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse) obj; + + if (getPurgeCount() != other.getPurgeCount()) return false; + if (!getPurgeSampleList().equals(other.getPurgeSampleList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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
+   * [DocumentService.PurgeDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.PurgeDocuments]
+   * method. 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.discoveryengine.v1alpha.PurgeDocumentsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse) + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse.class, + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + purgeCount_ = 0L; + purgeSample_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeDocumentsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse build() { + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse buildPartial() { + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse result = + new com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.purgeCount_ = purgeCount_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + purgeSample_.makeImmutable(); + result.purgeSample_ = purgeSample_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse.getDefaultInstance()) + return this; + if (other.getPurgeCount() != 0L) { + setPurgeCount(other.getPurgeCount()); + } + if (!other.purgeSample_.isEmpty()) { + if (purgeSample_.isEmpty()) { + purgeSample_ = other.purgeSample_; + bitField0_ |= 0x00000002; + } else { + ensurePurgeSampleIsMutable(); + purgeSample_.addAll(other.purgeSample_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + purgeCount_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensurePurgeSampleIsMutable(); + purgeSample_.add(s); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long purgeCount_; + /** + * + * + *
+     * The total count of documents 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 documents 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The total count of documents purged as a result of the operation.
+     * 
+ * + * int64 purge_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearPurgeCount() { + bitField0_ = (bitField0_ & ~0x00000001); + purgeCount_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList purgeSample_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensurePurgeSampleIsMutable() { + if (!purgeSample_.isModifiable()) { + purgeSample_ = new com.google.protobuf.LazyStringArrayList(purgeSample_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+     * A sample of document 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() { + purgeSample_.makeImmutable(); + return purgeSample_; + } + /** + * + * + *
+     * A sample of document 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 document 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 document 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 document 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); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A sample of document 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); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A sample of document 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_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A sample of document 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.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * A sample of document 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); + bitField0_ |= 0x00000002; + 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.discoveryengine.v1alpha.PurgeDocumentsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse) + private static final com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse(); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PurgeDocumentsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsResponseOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsResponseOrBuilder.java new file mode 100644 index 000000000000..f89c20dca255 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeDocumentsResponseOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/purge_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface PurgeDocumentsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The total count of documents purged as a result of the operation.
+   * 
+ * + * int64 purge_count = 1; + * + * @return The purgeCount. + */ + long getPurgeCount(); + + /** + * + * + *
+   * A sample of document 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 document 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 document 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 document 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/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsMetadata.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsMetadata.java new file mode 100644 index 000000000000..ac4c30ed17fd --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsMetadata.java @@ -0,0 +1,1169 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/purge_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Metadata related to the progress of the PurgeUserEvents operation.
+ * This will be returned by the google.longrunning.Operation.metadata field.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata} + */ +public final class PurgeUserEventsMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata) + PurgeUserEventsMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use PurgeUserEventsMetadata.newBuilder() to construct. + private PurgeUserEventsMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PurgeUserEventsMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PurgeUserEventsMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata.class, + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata.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 createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + 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 updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int SUCCESS_COUNT_FIELD_NUMBER = 3; + private long successCount_ = 0L; + /** + * + * + *
+   * 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_ = 0L; + /** + * + * + *
+   * 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_); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata other = + (com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata) 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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 PurgeUserEvents operation.
+   * This will be returned by the google.longrunning.Operation.metadata field.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata) + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata.class, + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + successCount_ = 0L; + failureCount_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata build() { + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata buildPartial() { + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata result = + new com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.successCount_ = successCount_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.failureCount_ = failureCount_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata.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.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + successCount_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + failureCount_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private 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 ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * 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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + 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(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000001); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000001; + 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 ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * 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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + 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(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + 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 (((bitField0_ & 0x00000002) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + 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() { + bitField0_ = (bitField0_ & ~0x00000002); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + 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() { + bitField0_ |= 0x00000002; + 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of entries that were deleted successfully.
+     * 
+ * + * int64 success_count = 3; + * + * @return This builder for chaining. + */ + public Builder clearSuccessCount() { + bitField0_ = (bitField0_ & ~0x00000004); + 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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Count of entries that encountered errors while processing.
+     * 
+ * + * int64 failure_count = 4; + * + * @return This builder for chaining. + */ + public Builder clearFailureCount() { + bitField0_ = (bitField0_ & ~0x00000008); + 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.discoveryengine.v1alpha.PurgeUserEventsMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata) + private static final com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata(); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PurgeUserEventsMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsMetadataOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsMetadataOrBuilder.java new file mode 100644 index 000000000000..a597f843666e --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsMetadataOrBuilder.java @@ -0,0 +1,124 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/purge_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface PurgeUserEventsMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata) + 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/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsRequest.java new file mode 100644 index 000000000000..35be7f76dff3 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsRequest.java @@ -0,0 +1,1123 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/purge_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request message for PurgeUserEvents method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest} + */ +public final class PurgeUserEventsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest.class, + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + 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/collections/{$collectionId}/dataStores/${dataStoreId}`
+   * 
+ * + * + * 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 catalog under which the events are
+   * created. The format is
+   * `projects/${projectId}/locations/global/collections/{$collectionId}/dataStores/${dataStoreId}`
+   * 
+ * + * + * 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; + + @SuppressWarnings("serial") + 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. The eligible fields for filtering are:
+   *
+   * * `eventType`: Double quoted
+   * [UserEvent.event_type][google.cloud.discoveryengine.v1alpha.UserEvent.event_type]
+   * string.
+   * * `eventTime`: in ISO 8601 "zulu" format.
+   * * `userPseudoId`: 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:
+   *   `eventType = "search"`
+   * * Deleting all events for a specific visitor:
+   *   `userPseudoId = "visitor1024"`
+   * * Deleting all events inside a DataStore:
+   *   `*`
+   *
+   * 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. The eligible fields for filtering are:
+   *
+   * * `eventType`: Double quoted
+   * [UserEvent.event_type][google.cloud.discoveryengine.v1alpha.UserEvent.event_type]
+   * string.
+   * * `eventTime`: in ISO 8601 "zulu" format.
+   * * `userPseudoId`: 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:
+   *   `eventType = "search"`
+   * * Deleting all events for a specific visitor:
+   *   `userPseudoId = "visitor1024"`
+   * * Deleting all events inside a DataStore:
+   *   `*`
+   *
+   * 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_ = false; + /** + * + * + *
+   * The `force` field is currently not supported. Purge user event requests
+   * will permanently delete all purgeable events. Once the development is
+   * complete:
+   * If `force` is set to false, the method will return the expected
+   * purge count without deleting any user events. This field will default to
+   * false if not included in the request.
+   * 
+ * + * 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_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest other = + (com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getForce() != other.getForce()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.PurgeUserEventsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.PurgeUserEventsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.PurgeUserEventsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.PurgeUserEventsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.PurgeUserEventsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest) + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest.class, + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + filter_ = ""; + force_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest build() { + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest result = + new com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.force_ = force_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getForce() != false) { + setForce(other.getForce()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + force_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource name of the catalog under which the events are
+     * created. The format is
+     * `projects/${projectId}/locations/global/collections/{$collectionId}/dataStores/${dataStoreId}`
+     * 
+ * + * + * 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 catalog under which the events are
+     * created. The format is
+     * `projects/${projectId}/locations/global/collections/{$collectionId}/dataStores/${dataStoreId}`
+     * 
+ * + * + * 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 catalog under which the events are
+     * created. The format is
+     * `projects/${projectId}/locations/global/collections/{$collectionId}/dataStores/${dataStoreId}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the catalog under which the events are
+     * created. The format is
+     * `projects/${projectId}/locations/global/collections/{$collectionId}/dataStores/${dataStoreId}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the catalog under which the events are
+     * created. The format is
+     * `projects/${projectId}/locations/global/collections/{$collectionId}/dataStores/${dataStoreId}`
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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. The eligible fields for filtering are:
+     *
+     * * `eventType`: Double quoted
+     * [UserEvent.event_type][google.cloud.discoveryengine.v1alpha.UserEvent.event_type]
+     * string.
+     * * `eventTime`: in ISO 8601 "zulu" format.
+     * * `userPseudoId`: 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:
+     *   `eventType = "search"`
+     * * Deleting all events for a specific visitor:
+     *   `userPseudoId = "visitor1024"`
+     * * Deleting all events inside a DataStore:
+     *   `*`
+     *
+     * 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. The eligible fields for filtering are:
+     *
+     * * `eventType`: Double quoted
+     * [UserEvent.event_type][google.cloud.discoveryengine.v1alpha.UserEvent.event_type]
+     * string.
+     * * `eventTime`: in ISO 8601 "zulu" format.
+     * * `userPseudoId`: 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:
+     *   `eventType = "search"`
+     * * Deleting all events for a specific visitor:
+     *   `userPseudoId = "visitor1024"`
+     * * Deleting all events inside a DataStore:
+     *   `*`
+     *
+     * 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. The eligible fields for filtering are:
+     *
+     * * `eventType`: Double quoted
+     * [UserEvent.event_type][google.cloud.discoveryengine.v1alpha.UserEvent.event_type]
+     * string.
+     * * `eventTime`: in ISO 8601 "zulu" format.
+     * * `userPseudoId`: 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:
+     *   `eventType = "search"`
+     * * Deleting all events for a specific visitor:
+     *   `userPseudoId = "visitor1024"`
+     * * Deleting all events inside a DataStore:
+     *   `*`
+     *
+     * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The filter string to specify the events to be deleted with a
+     * length limit of 5,000 characters. The eligible fields for filtering are:
+     *
+     * * `eventType`: Double quoted
+     * [UserEvent.event_type][google.cloud.discoveryengine.v1alpha.UserEvent.event_type]
+     * string.
+     * * `eventTime`: in ISO 8601 "zulu" format.
+     * * `userPseudoId`: 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:
+     *   `eventType = "search"`
+     * * Deleting all events for a specific visitor:
+     *   `userPseudoId = "visitor1024"`
+     * * Deleting all events inside a DataStore:
+     *   `*`
+     *
+     * 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(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The filter string to specify the events to be deleted with a
+     * length limit of 5,000 characters. The eligible fields for filtering are:
+     *
+     * * `eventType`: Double quoted
+     * [UserEvent.event_type][google.cloud.discoveryengine.v1alpha.UserEvent.event_type]
+     * string.
+     * * `eventTime`: in ISO 8601 "zulu" format.
+     * * `userPseudoId`: 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:
+     *   `eventType = "search"`
+     * * Deleting all events for a specific visitor:
+     *   `userPseudoId = "visitor1024"`
+     * * Deleting all events inside a DataStore:
+     *   `*`
+     *
+     * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean force_; + /** + * + * + *
+     * The `force` field is currently not supported. Purge user event requests
+     * will permanently delete all purgeable events. Once the development is
+     * complete:
+     * If `force` is set to false, the method will return the expected
+     * purge count without deleting any user events. This field will default to
+     * false if not included in the request.
+     * 
+ * + * bool force = 3; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * The `force` field is currently not supported. Purge user event requests
+     * will permanently delete all purgeable events. Once the development is
+     * complete:
+     * If `force` is set to false, the method will return the expected
+     * purge count without deleting any user events. This field will default to
+     * false if not included in the request.
+     * 
+ * + * bool force = 3; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The `force` field is currently not supported. Purge user event requests
+     * will permanently delete all purgeable events. Once the development is
+     * complete:
+     * If `force` is set to false, the method will return the expected
+     * purge count without deleting any user events. This field will default to
+     * false if not included in the request.
+     * 
+ * + * bool force = 3; + * + * @return This builder for chaining. + */ + public Builder clearForce() { + bitField0_ = (bitField0_ & ~0x00000004); + 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.discoveryengine.v1alpha.PurgeUserEventsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest) + private static final com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsRequestOrBuilder.java new file mode 100644 index 000000000000..bce22cc73ec1 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsRequestOrBuilder.java @@ -0,0 +1,149 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/purge_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface PurgeUserEventsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.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/collections/{$collectionId}/dataStores/${dataStoreId}`
+   * 
+ * + * + * 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 catalog under which the events are
+   * created. The format is
+   * `projects/${projectId}/locations/global/collections/{$collectionId}/dataStores/${dataStoreId}`
+   * 
+ * + * + * 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 events to be deleted with a
+   * length limit of 5,000 characters. The eligible fields for filtering are:
+   *
+   * * `eventType`: Double quoted
+   * [UserEvent.event_type][google.cloud.discoveryengine.v1alpha.UserEvent.event_type]
+   * string.
+   * * `eventTime`: in ISO 8601 "zulu" format.
+   * * `userPseudoId`: 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:
+   *   `eventType = "search"`
+   * * Deleting all events for a specific visitor:
+   *   `userPseudoId = "visitor1024"`
+   * * Deleting all events inside a DataStore:
+   *   `*`
+   *
+   * 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. The eligible fields for filtering are:
+   *
+   * * `eventType`: Double quoted
+   * [UserEvent.event_type][google.cloud.discoveryengine.v1alpha.UserEvent.event_type]
+   * string.
+   * * `eventTime`: in ISO 8601 "zulu" format.
+   * * `userPseudoId`: 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:
+   *   `eventType = "search"`
+   * * Deleting all events for a specific visitor:
+   *   `userPseudoId = "visitor1024"`
+   * * Deleting all events inside a DataStore:
+   *   `*`
+   *
+   * 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(); + + /** + * + * + *
+   * The `force` field is currently not supported. Purge user event requests
+   * will permanently delete all purgeable events. Once the development is
+   * complete:
+   * If `force` is set to false, the method will return the expected
+   * purge count without deleting any user events. This field will default to
+   * false if not included in the request.
+   * 
+ * + * bool force = 3; + * + * @return The force. + */ + boolean getForce(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsResponse.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsResponse.java new file mode 100644 index 000000000000..944881e07734 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsResponse.java @@ -0,0 +1,546 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/purge_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * 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.discoveryengine.v1alpha.PurgeUserEventsResponse} + */ +public final class PurgeUserEventsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse.class, + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse.Builder.class); + } + + public static final int PURGE_COUNT_FIELD_NUMBER = 1; + private long purgeCount_ = 0L; + /** + * + * + *
+   * The total count of events purged as a result of the operation.
+   * 
+ * + * int64 purge_count = 1; + * + * @return The purgeCount. + */ + @java.lang.Override + public long getPurgeCount() { + return purgeCount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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_); + } + getUnknownFields().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_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse other = + (com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse) obj; + + if (getPurgeCount() != other.getPurgeCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PURGE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPurgeCount()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.PurgeUserEventsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.PurgeUserEventsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.PurgeUserEventsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.PurgeUserEventsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.PurgeUserEventsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse) + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse.class, + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + purgeCount_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.PurgeConfigProto + .internal_static_google_cloud_discoveryengine_v1alpha_PurgeUserEventsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse build() { + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse buildPartial() { + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse result = + new com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.purgeCount_ = purgeCount_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse.getDefaultInstance()) + return this; + if (other.getPurgeCount() != 0L) { + setPurgeCount(other.getPurgeCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + purgeCount_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long purgeCount_; + /** + * + * + *
+     * The total count of events 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 events 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The total count of events purged as a result of the operation.
+     * 
+ * + * int64 purge_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearPurgeCount() { + bitField0_ = (bitField0_ & ~0x00000001); + purgeCount_ = 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.discoveryengine.v1alpha.PurgeUserEventsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse) + private static final com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsResponseOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsResponseOrBuilder.java new file mode 100644 index 000000000000..4eb042a5d4e2 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/PurgeUserEventsResponseOrBuilder.java @@ -0,0 +1,38 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/purge_config.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface PurgeUserEventsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The total count of events purged as a result of the operation.
+   * 
+ * + * int64 purge_count = 1; + * + * @return The purgeCount. + */ + long getPurgeCount(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendRequest.java new file mode 100644 index 000000000000..a1796ec38b2d --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendRequest.java @@ -0,0 +1,2819 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/recommendation_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request message for Recommend method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.RecommendRequest} + */ +public final class RecommendRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.RecommendRequest) + RecommendRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RecommendRequest.newBuilder() to construct. + private RecommendRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RecommendRequest() { + servingConfig_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RecommendRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.RecommendationServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetParams(); + case 8: + return internalGetUserLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.RecommendationServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.RecommendRequest.class, + com.google.cloud.discoveryengine.v1alpha.RecommendRequest.Builder.class); + } + + public static final int SERVING_CONFIG_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object servingConfig_ = ""; + /** + * + * + *
+   * Required. Full resource name of the format:
+   * `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*`
+   *
+   * Before you can request recommendations from your model, you must create at
+   * least one serving config  for it.
+   * 
+ * + * + * 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. Full resource name of the format:
+   * `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*`
+   *
+   * Before you can request recommendations from your model, you must create at
+   * least one serving config  for it.
+   * 
+ * + * + * 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 USER_EVENT_FIELD_NUMBER = 2; + private com.google.cloud.discoveryengine.v1alpha.UserEvent userEvent_; + /** + * + * + *
+   * Required. Context about the user, what they are looking at and what action
+   * they took to trigger the Recommend 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.
+   *
+   * Don't set
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * or
+   * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+   * to the same fixed ID for different users. If you are trying to receive
+   * non-personalized recommendations (not recommended; this can negatively
+   * impact model performance), instead set
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * to a random unique ID and leave
+   * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+   * unset.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.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 Recommend 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.
+   *
+   * Don't set
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * or
+   * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+   * to the same fixed ID for different users. If you are trying to receive
+   * non-personalized recommendations (not recommended; this can negatively
+   * impact model performance), instead set
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * to a random unique ID and leave
+   * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+   * unset.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UserEvent getUserEvent() { + return userEvent_ == null + ? com.google.cloud.discoveryengine.v1alpha.UserEvent.getDefaultInstance() + : userEvent_; + } + /** + * + * + *
+   * Required. Context about the user, what they are looking at and what action
+   * they took to trigger the Recommend 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.
+   *
+   * Don't set
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * or
+   * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+   * to the same fixed ID for different users. If you are trying to receive
+   * non-personalized recommendations (not recommended; this can negatively
+   * impact model performance), instead set
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * to a random unique ID and leave
+   * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+   * unset.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UserEventOrBuilder getUserEventOrBuilder() { + return userEvent_ == null + ? com.google.cloud.discoveryengine.v1alpha.UserEvent.getDefaultInstance() + : userEvent_; + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_ = 0; + /** + * + * + *
+   * Maximum number of results to return. Set this property
+   * to the number of recommendation 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 FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Filter for restricting recommendation results with a length limit of 5,000
+   * characters. Currently, only filter expressions on the `filter_tags`
+   * attribute is supported.
+   *
+   *
+   * Examples:
+   *
+   *  * `(filter_tags: ANY("Red", "Blue") OR filter_tags: ANY("Hot", "Cold"))`
+   *  * `(filter_tags: ANY("Red", "Blue")) AND NOT (filter_tags: ANY("Green"))`
+   *
+   * If `attributeFilteringSyntax` is set to true under the `params` field, then
+   * attribute-based expressions are expected instead of the above described
+   * tag-based syntax. Examples:
+   *
+   *  * (launguage: ANY("en", "es")) AND NOT (categories: ANY("Movie"))
+   *  * (available: true) AND
+   *    (launguage: ANY("en", "es")) OR (categories: ANY("Movie"))
+   *
+   * If your filter blocks all results, the API will return generic
+   * (unfiltered) popular Documents. If you only want results strictly matching
+   * the filters, set `strictFiltering` to True in
+   * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params]
+   * to receive empty results instead.
+   *
+   * Note that the API will never return
+   * [Document][google.cloud.discoveryengine.v1alpha.Document]s with
+   * `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * Filter for restricting recommendation results with a length limit of 5,000
+   * characters. Currently, only filter expressions on the `filter_tags`
+   * attribute is supported.
+   *
+   *
+   * Examples:
+   *
+   *  * `(filter_tags: ANY("Red", "Blue") OR filter_tags: ANY("Hot", "Cold"))`
+   *  * `(filter_tags: ANY("Red", "Blue")) AND NOT (filter_tags: ANY("Green"))`
+   *
+   * If `attributeFilteringSyntax` is set to true under the `params` field, then
+   * attribute-based expressions are expected instead of the above described
+   * tag-based syntax. Examples:
+   *
+   *  * (launguage: ANY("en", "es")) AND NOT (categories: ANY("Movie"))
+   *  * (available: true) AND
+   *    (launguage: ANY("en", "es")) OR (categories: ANY("Movie"))
+   *
+   * If your filter blocks all results, the API will return generic
+   * (unfiltered) popular Documents. If you only want results strictly matching
+   * the filters, set `strictFiltering` to True in
+   * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params]
+   * to receive empty results instead.
+   *
+   * Note that the API will never return
+   * [Document][google.cloud.discoveryengine.v1alpha.Document]s with
+   * `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices.
+   * 
+ * + * 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 VALIDATE_ONLY_FIELD_NUMBER = 5; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Use validate only mode for this recommendation query. If set to true, a
+   * fake model will be used that returns arbitrary Document IDs.
+   * Note that the validate only mode should only be used for testing the API,
+   * or if the model is not ready.
+   * 
+ * + * bool validate_only = 5; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int PARAMS_FIELD_NUMBER = 6; + + private static final class ParamsDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.discoveryengine.v1alpha.RecommendationServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_ParamsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.Value.getDefaultInstance()); + } + + @SuppressWarnings("serial") + 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 recommendations.
+   *
+   * Allowed values:
+   *
+   * * `returnDocument`: Boolean. If set to true, the associated Document
+   *    object will be returned in
+   *    [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.document].
+   * * `returnScore`: Boolean. If set to true, the recommendation 'score'
+   *    corresponding to each returned Document will be set in
+   *    [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.metadata].
+   *    The given 'score' indicates the probability of a Document conversion
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular Documents instead of empty if
+   *    your filter blocks all recommendation results.
+   * * `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 recommendation results
+   *    based on Document category.
+   * * `attributeFilteringSyntax`: Boolean. False by default. If set to true,
+   *    the `filter` field is interpreted according to the new,
+   *    attribute-based syntax.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 6; + */ + @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 recommendations.
+   *
+   * Allowed values:
+   *
+   * * `returnDocument`: Boolean. If set to true, the associated Document
+   *    object will be returned in
+   *    [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.document].
+   * * `returnScore`: Boolean. If set to true, the recommendation 'score'
+   *    corresponding to each returned Document will be set in
+   *    [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.metadata].
+   *    The given 'score' indicates the probability of a Document conversion
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular Documents instead of empty if
+   *    your filter blocks all recommendation results.
+   * * `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 recommendation results
+   *    based on Document category.
+   * * `attributeFilteringSyntax`: Boolean. False by default. If set to true,
+   *    the `filter` field is interpreted according to the new,
+   *    attribute-based syntax.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 6; + */ + @java.lang.Override + public java.util.Map getParamsMap() { + return internalGetParams().getMap(); + } + /** + * + * + *
+   * Additional domain specific parameters for the recommendations.
+   *
+   * Allowed values:
+   *
+   * * `returnDocument`: Boolean. If set to true, the associated Document
+   *    object will be returned in
+   *    [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.document].
+   * * `returnScore`: Boolean. If set to true, the recommendation 'score'
+   *    corresponding to each returned Document will be set in
+   *    [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.metadata].
+   *    The given 'score' indicates the probability of a Document conversion
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular Documents instead of empty if
+   *    your filter blocks all recommendation results.
+   * * `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 recommendation results
+   *    based on Document category.
+   * * `attributeFilteringSyntax`: Boolean. False by default. If set to true,
+   *    the `filter` field is interpreted according to the new,
+   *    attribute-based syntax.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 6; + */ + @java.lang.Override + public /* nullable */ com.google.protobuf.Value getParamsOrDefault( + java.lang.String key, + /* nullable */ + 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 recommendations.
+   *
+   * Allowed values:
+   *
+   * * `returnDocument`: Boolean. If set to true, the associated Document
+   *    object will be returned in
+   *    [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.document].
+   * * `returnScore`: Boolean. If set to true, the recommendation 'score'
+   *    corresponding to each returned Document will be set in
+   *    [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.metadata].
+   *    The given 'score' indicates the probability of a Document conversion
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular Documents instead of empty if
+   *    your filter blocks all recommendation results.
+   * * `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 recommendation results
+   *    based on Document category.
+   * * `attributeFilteringSyntax`: Boolean. False by default. If set to true,
+   *    the `filter` field is interpreted according to the new,
+   *    attribute-based syntax.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 6; + */ + @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 USER_LABELS_FIELD_NUMBER = 8; + + private static final class UserLabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.discoveryengine.v1alpha.RecommendationServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_UserLabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField userLabels_; + + private com.google.protobuf.MapField internalGetUserLabels() { + if (userLabels_ == null) { + return com.google.protobuf.MapField.emptyMapField(UserLabelsDefaultEntryHolder.defaultEntry); + } + return userLabels_; + } + + public int getUserLabelsCount() { + return internalGetUserLabels().getMap().size(); + } + /** + * + * + *
+   * The user 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 [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 8; + */ + @java.lang.Override + public boolean containsUserLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetUserLabels().getMap().containsKey(key); + } + /** Use {@link #getUserLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getUserLabels() { + return getUserLabelsMap(); + } + /** + * + * + *
+   * The user 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 [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 8; + */ + @java.lang.Override + public java.util.Map getUserLabelsMap() { + return internalGetUserLabels().getMap(); + } + /** + * + * + *
+   * The user 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 [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 8; + */ + @java.lang.Override + public /* nullable */ java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * The user 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 [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 8; + */ + @java.lang.Override + public java.lang.String getUserLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().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(servingConfig_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, servingConfig_); + } + if (userEvent_ != null) { + output.writeMessage(2, getUserEvent()); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (validateOnly_ != false) { + output.writeBool(5, validateOnly_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetParams(), ParamsDefaultEntryHolder.defaultEntry, 6); + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetUserLabels(), UserLabelsDefaultEntryHolder.defaultEntry, 8); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(servingConfig_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, servingConfig_); + } + 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(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, 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(6, params__); + } + for (java.util.Map.Entry entry : + internalGetUserLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry userLabels__ = + UserLabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, userLabels__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.RecommendRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.RecommendRequest other = + (com.google.cloud.discoveryengine.v1alpha.RecommendRequest) obj; + + if (!getServingConfig().equals(other.getServingConfig())) return false; + if (hasUserEvent() != other.hasUserEvent()) return false; + if (hasUserEvent()) { + if (!getUserEvent().equals(other.getUserEvent())) return false; + } + if (getPageSize() != other.getPageSize()) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!internalGetParams().equals(other.internalGetParams())) return false; + if (!internalGetUserLabels().equals(other.internalGetUserLabels())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SERVING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getServingConfig().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) + 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 (!internalGetUserLabels().getMap().isEmpty()) { + hash = (37 * hash) + USER_LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetUserLabels().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.RecommendRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 Recommend method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.RecommendRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.RecommendRequest) + com.google.cloud.discoveryengine.v1alpha.RecommendRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.RecommendationServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetParams(); + case 8: + return internalGetUserLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 6: + return internalGetMutableParams(); + case 8: + return internalGetMutableUserLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.RecommendationServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.RecommendRequest.class, + com.google.cloud.discoveryengine.v1alpha.RecommendRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.RecommendRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + servingConfig_ = ""; + userEvent_ = null; + if (userEventBuilder_ != null) { + userEventBuilder_.dispose(); + userEventBuilder_ = null; + } + pageSize_ = 0; + filter_ = ""; + validateOnly_ = false; + internalGetMutableParams().clear(); + internalGetMutableUserLabels().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.RecommendationServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecommendRequest getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.RecommendRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecommendRequest build() { + com.google.cloud.discoveryengine.v1alpha.RecommendRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecommendRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.RecommendRequest result = + new com.google.cloud.discoveryengine.v1alpha.RecommendRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.RecommendRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.servingConfig_ = servingConfig_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.userEvent_ = userEventBuilder_ == null ? userEvent_ : userEventBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.params_ = internalGetParams(); + result.params_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.userLabels_ = internalGetUserLabels(); + result.userLabels_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.RecommendRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.RecommendRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.RecommendRequest other) { + if (other == com.google.cloud.discoveryengine.v1alpha.RecommendRequest.getDefaultInstance()) + return this; + if (!other.getServingConfig().isEmpty()) { + servingConfig_ = other.servingConfig_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasUserEvent()) { + mergeUserEvent(other.getUserEvent()); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + internalGetMutableParams().mergeFrom(other.internalGetParams()); + bitField0_ |= 0x00000020; + internalGetMutableUserLabels().mergeFrom(other.internalGetUserLabels()); + bitField0_ |= 0x00000040; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + servingConfig_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUserEventFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: + { + com.google.protobuf.MapEntry params__ = + input.readMessage( + ParamsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableParams() + .getMutableMap() + .put(params__.getKey(), params__.getValue()); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 66: + { + com.google.protobuf.MapEntry userLabels__ = + input.readMessage( + UserLabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableUserLabels() + .getMutableMap() + .put(userLabels__.getKey(), userLabels__.getValue()); + bitField0_ |= 0x00000040; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object servingConfig_ = ""; + /** + * + * + *
+     * Required. Full resource name of the format:
+     * `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*`
+     *
+     * Before you can request recommendations from your model, you must create at
+     * least one serving config  for it.
+     * 
+ * + * + * 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. Full resource name of the format:
+     * `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*`
+     *
+     * Before you can request recommendations from your model, you must create at
+     * least one serving config  for it.
+     * 
+ * + * + * 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. Full resource name of the format:
+     * `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*`
+     *
+     * Before you can request recommendations from your model, you must create at
+     * least one serving config  for it.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of the format:
+     * `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*`
+     *
+     * Before you can request recommendations from your model, you must create at
+     * least one serving config  for it.
+     * 
+ * + * + * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearServingConfig() { + servingConfig_ = getDefaultInstance().getServingConfig(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of the format:
+     * `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*`
+     *
+     * Before you can request recommendations from your model, you must create at
+     * least one serving config  for it.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1alpha.UserEvent userEvent_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.UserEvent, + com.google.cloud.discoveryengine.v1alpha.UserEvent.Builder, + com.google.cloud.discoveryengine.v1alpha.UserEventOrBuilder> + userEventBuilder_; + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the Recommend 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.
+     *
+     * Don't set
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * or
+     * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+     * to the same fixed ID for different users. If you are trying to receive
+     * non-personalized recommendations (not recommended; this can negatively
+     * impact model performance), instead set
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * to a random unique ID and leave
+     * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+     * unset.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEvent field is set. + */ + public boolean hasUserEvent() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the Recommend 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.
+     *
+     * Don't set
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * or
+     * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+     * to the same fixed ID for different users. If you are trying to receive
+     * non-personalized recommendations (not recommended; this can negatively
+     * impact model performance), instead set
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * to a random unique ID and leave
+     * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+     * unset.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + public com.google.cloud.discoveryengine.v1alpha.UserEvent getUserEvent() { + if (userEventBuilder_ == null) { + return userEvent_ == null + ? com.google.cloud.discoveryengine.v1alpha.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 Recommend 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.
+     *
+     * Don't set
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * or
+     * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+     * to the same fixed ID for different users. If you are trying to receive
+     * non-personalized recommendations (not recommended; this can negatively
+     * impact model performance), instead set
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * to a random unique ID and leave
+     * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+     * unset.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEvent(com.google.cloud.discoveryengine.v1alpha.UserEvent value) { + if (userEventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userEvent_ = value; + } else { + userEventBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the Recommend 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.
+     *
+     * Don't set
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * or
+     * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+     * to the same fixed ID for different users. If you are trying to receive
+     * non-personalized recommendations (not recommended; this can negatively
+     * impact model performance), instead set
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * to a random unique ID and leave
+     * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+     * unset.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEvent( + com.google.cloud.discoveryengine.v1alpha.UserEvent.Builder builderForValue) { + if (userEventBuilder_ == null) { + userEvent_ = builderForValue.build(); + } else { + userEventBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the Recommend 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.
+     *
+     * Don't set
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * or
+     * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+     * to the same fixed ID for different users. If you are trying to receive
+     * non-personalized recommendations (not recommended; this can negatively
+     * impact model performance), instead set
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * to a random unique ID and leave
+     * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+     * unset.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUserEvent(com.google.cloud.discoveryengine.v1alpha.UserEvent value) { + if (userEventBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && userEvent_ != null + && userEvent_ + != com.google.cloud.discoveryengine.v1alpha.UserEvent.getDefaultInstance()) { + getUserEventBuilder().mergeFrom(value); + } else { + userEvent_ = value; + } + } else { + userEventBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the Recommend 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.
+     *
+     * Don't set
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * or
+     * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+     * to the same fixed ID for different users. If you are trying to receive
+     * non-personalized recommendations (not recommended; this can negatively
+     * impact model performance), instead set
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * to a random unique ID and leave
+     * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+     * unset.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUserEvent() { + bitField0_ = (bitField0_ & ~0x00000002); + userEvent_ = null; + if (userEventBuilder_ != null) { + userEventBuilder_.dispose(); + userEventBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the Recommend 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.
+     *
+     * Don't set
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * or
+     * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+     * to the same fixed ID for different users. If you are trying to receive
+     * non-personalized recommendations (not recommended; this can negatively
+     * impact model performance), instead set
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * to a random unique ID and leave
+     * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+     * unset.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.UserEvent.Builder getUserEventBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUserEventFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the Recommend 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.
+     *
+     * Don't set
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * or
+     * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+     * to the same fixed ID for different users. If you are trying to receive
+     * non-personalized recommendations (not recommended; this can negatively
+     * impact model performance), instead set
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * to a random unique ID and leave
+     * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+     * unset.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.UserEventOrBuilder getUserEventOrBuilder() { + if (userEventBuilder_ != null) { + return userEventBuilder_.getMessageOrBuilder(); + } else { + return userEvent_ == null + ? com.google.cloud.discoveryengine.v1alpha.UserEvent.getDefaultInstance() + : userEvent_; + } + } + /** + * + * + *
+     * Required. Context about the user, what they are looking at and what action
+     * they took to trigger the Recommend 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.
+     *
+     * Don't set
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * or
+     * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+     * to the same fixed ID for different users. If you are trying to receive
+     * non-personalized recommendations (not recommended; this can negatively
+     * impact model performance), instead set
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * to a random unique ID and leave
+     * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+     * unset.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.UserEvent, + com.google.cloud.discoveryengine.v1alpha.UserEvent.Builder, + com.google.cloud.discoveryengine.v1alpha.UserEventOrBuilder> + getUserEventFieldBuilder() { + if (userEventBuilder_ == null) { + userEventBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.UserEvent, + com.google.cloud.discoveryengine.v1alpha.UserEvent.Builder, + com.google.cloud.discoveryengine.v1alpha.UserEventOrBuilder>( + getUserEvent(), getParentForChildren(), isClean()); + userEvent_ = null; + } + return userEventBuilder_; + } + + private int pageSize_; + /** + * + * + *
+     * Maximum number of results to return. Set this property
+     * to the number of recommendation 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. Set this property
+     * to the number of recommendation 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of results to return. Set this property
+     * to the number of recommendation 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() { + bitField0_ = (bitField0_ & ~0x00000004); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Filter for restricting recommendation results with a length limit of 5,000
+     * characters. Currently, only filter expressions on the `filter_tags`
+     * attribute is supported.
+     *
+     *
+     * Examples:
+     *
+     *  * `(filter_tags: ANY("Red", "Blue") OR filter_tags: ANY("Hot", "Cold"))`
+     *  * `(filter_tags: ANY("Red", "Blue")) AND NOT (filter_tags: ANY("Green"))`
+     *
+     * If `attributeFilteringSyntax` is set to true under the `params` field, then
+     * attribute-based expressions are expected instead of the above described
+     * tag-based syntax. Examples:
+     *
+     *  * (launguage: ANY("en", "es")) AND NOT (categories: ANY("Movie"))
+     *  * (available: true) AND
+     *    (launguage: ANY("en", "es")) OR (categories: ANY("Movie"))
+     *
+     * If your filter blocks all results, the API will return generic
+     * (unfiltered) popular Documents. If you only want results strictly matching
+     * the filters, set `strictFiltering` to True in
+     * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params]
+     * to receive empty results instead.
+     *
+     * Note that the API will never return
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s with
+     * `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Filter for restricting recommendation results with a length limit of 5,000
+     * characters. Currently, only filter expressions on the `filter_tags`
+     * attribute is supported.
+     *
+     *
+     * Examples:
+     *
+     *  * `(filter_tags: ANY("Red", "Blue") OR filter_tags: ANY("Hot", "Cold"))`
+     *  * `(filter_tags: ANY("Red", "Blue")) AND NOT (filter_tags: ANY("Green"))`
+     *
+     * If `attributeFilteringSyntax` is set to true under the `params` field, then
+     * attribute-based expressions are expected instead of the above described
+     * tag-based syntax. Examples:
+     *
+     *  * (launguage: ANY("en", "es")) AND NOT (categories: ANY("Movie"))
+     *  * (available: true) AND
+     *    (launguage: ANY("en", "es")) OR (categories: ANY("Movie"))
+     *
+     * If your filter blocks all results, the API will return generic
+     * (unfiltered) popular Documents. If you only want results strictly matching
+     * the filters, set `strictFiltering` to True in
+     * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params]
+     * to receive empty results instead.
+     *
+     * Note that the API will never return
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s with
+     * `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Filter for restricting recommendation results with a length limit of 5,000
+     * characters. Currently, only filter expressions on the `filter_tags`
+     * attribute is supported.
+     *
+     *
+     * Examples:
+     *
+     *  * `(filter_tags: ANY("Red", "Blue") OR filter_tags: ANY("Hot", "Cold"))`
+     *  * `(filter_tags: ANY("Red", "Blue")) AND NOT (filter_tags: ANY("Green"))`
+     *
+     * If `attributeFilteringSyntax` is set to true under the `params` field, then
+     * attribute-based expressions are expected instead of the above described
+     * tag-based syntax. Examples:
+     *
+     *  * (launguage: ANY("en", "es")) AND NOT (categories: ANY("Movie"))
+     *  * (available: true) AND
+     *    (launguage: ANY("en", "es")) OR (categories: ANY("Movie"))
+     *
+     * If your filter blocks all results, the API will return generic
+     * (unfiltered) popular Documents. If you only want results strictly matching
+     * the filters, set `strictFiltering` to True in
+     * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params]
+     * to receive empty results instead.
+     *
+     * Note that the API will never return
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s with
+     * `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices.
+     * 
+ * + * 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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Filter for restricting recommendation results with a length limit of 5,000
+     * characters. Currently, only filter expressions on the `filter_tags`
+     * attribute is supported.
+     *
+     *
+     * Examples:
+     *
+     *  * `(filter_tags: ANY("Red", "Blue") OR filter_tags: ANY("Hot", "Cold"))`
+     *  * `(filter_tags: ANY("Red", "Blue")) AND NOT (filter_tags: ANY("Green"))`
+     *
+     * If `attributeFilteringSyntax` is set to true under the `params` field, then
+     * attribute-based expressions are expected instead of the above described
+     * tag-based syntax. Examples:
+     *
+     *  * (launguage: ANY("en", "es")) AND NOT (categories: ANY("Movie"))
+     *  * (available: true) AND
+     *    (launguage: ANY("en", "es")) OR (categories: ANY("Movie"))
+     *
+     * If your filter blocks all results, the API will return generic
+     * (unfiltered) popular Documents. If you only want results strictly matching
+     * the filters, set `strictFiltering` to True in
+     * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params]
+     * to receive empty results instead.
+     *
+     * Note that the API will never return
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s with
+     * `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices.
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Filter for restricting recommendation results with a length limit of 5,000
+     * characters. Currently, only filter expressions on the `filter_tags`
+     * attribute is supported.
+     *
+     *
+     * Examples:
+     *
+     *  * `(filter_tags: ANY("Red", "Blue") OR filter_tags: ANY("Hot", "Cold"))`
+     *  * `(filter_tags: ANY("Red", "Blue")) AND NOT (filter_tags: ANY("Green"))`
+     *
+     * If `attributeFilteringSyntax` is set to true under the `params` field, then
+     * attribute-based expressions are expected instead of the above described
+     * tag-based syntax. Examples:
+     *
+     *  * (launguage: ANY("en", "es")) AND NOT (categories: ANY("Movie"))
+     *  * (available: true) AND
+     *    (launguage: ANY("en", "es")) OR (categories: ANY("Movie"))
+     *
+     * If your filter blocks all results, the API will return generic
+     * (unfiltered) popular Documents. If you only want results strictly matching
+     * the filters, set `strictFiltering` to True in
+     * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params]
+     * to receive empty results instead.
+     *
+     * Note that the API will never return
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s with
+     * `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices.
+     * 
+ * + * 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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Use validate only mode for this recommendation query. If set to true, a
+     * fake model will be used that returns arbitrary Document IDs.
+     * Note that the validate only mode should only be used for testing the API,
+     * or if the model is not ready.
+     * 
+ * + * bool validate_only = 5; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Use validate only mode for this recommendation query. If set to true, a
+     * fake model will be used that returns arbitrary Document IDs.
+     * Note that the validate only mode should only be used for testing the API,
+     * or if the model is not ready.
+     * 
+ * + * bool validate_only = 5; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Use validate only mode for this recommendation query. If set to true, a
+     * fake model will be used that returns arbitrary Document IDs.
+     * Note that the validate only mode should only be used for testing the API,
+     * or if the model is not ready.
+     * 
+ * + * bool validate_only = 5; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000010); + 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() { + if (params_ == null) { + params_ = com.google.protobuf.MapField.newMapField(ParamsDefaultEntryHolder.defaultEntry); + } + if (!params_.isMutable()) { + params_ = params_.copy(); + } + bitField0_ |= 0x00000020; + onChanged(); + return params_; + } + + public int getParamsCount() { + return internalGetParams().getMap().size(); + } + /** + * + * + *
+     * Additional domain specific parameters for the recommendations.
+     *
+     * Allowed values:
+     *
+     * * `returnDocument`: Boolean. If set to true, the associated Document
+     *    object will be returned in
+     *    [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.document].
+     * * `returnScore`: Boolean. If set to true, the recommendation 'score'
+     *    corresponding to each returned Document will be set in
+     *    [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.metadata].
+     *    The given 'score' indicates the probability of a Document conversion
+     *    given the user's context and history.
+     * * `strictFiltering`: Boolean. True by default. If set to false, the service
+     *    will return generic (unfiltered) popular Documents instead of empty if
+     *    your filter blocks all recommendation results.
+     * * `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 recommendation results
+     *    based on Document category.
+     * * `attributeFilteringSyntax`: Boolean. False by default. If set to true,
+     *    the `filter` field is interpreted according to the new,
+     *    attribute-based syntax.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 6; + */ + @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 recommendations.
+     *
+     * Allowed values:
+     *
+     * * `returnDocument`: Boolean. If set to true, the associated Document
+     *    object will be returned in
+     *    [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.document].
+     * * `returnScore`: Boolean. If set to true, the recommendation 'score'
+     *    corresponding to each returned Document will be set in
+     *    [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.metadata].
+     *    The given 'score' indicates the probability of a Document conversion
+     *    given the user's context and history.
+     * * `strictFiltering`: Boolean. True by default. If set to false, the service
+     *    will return generic (unfiltered) popular Documents instead of empty if
+     *    your filter blocks all recommendation results.
+     * * `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 recommendation results
+     *    based on Document category.
+     * * `attributeFilteringSyntax`: Boolean. False by default. If set to true,
+     *    the `filter` field is interpreted according to the new,
+     *    attribute-based syntax.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 6; + */ + @java.lang.Override + public java.util.Map getParamsMap() { + return internalGetParams().getMap(); + } + /** + * + * + *
+     * Additional domain specific parameters for the recommendations.
+     *
+     * Allowed values:
+     *
+     * * `returnDocument`: Boolean. If set to true, the associated Document
+     *    object will be returned in
+     *    [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.document].
+     * * `returnScore`: Boolean. If set to true, the recommendation 'score'
+     *    corresponding to each returned Document will be set in
+     *    [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.metadata].
+     *    The given 'score' indicates the probability of a Document conversion
+     *    given the user's context and history.
+     * * `strictFiltering`: Boolean. True by default. If set to false, the service
+     *    will return generic (unfiltered) popular Documents instead of empty if
+     *    your filter blocks all recommendation results.
+     * * `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 recommendation results
+     *    based on Document category.
+     * * `attributeFilteringSyntax`: Boolean. False by default. If set to true,
+     *    the `filter` field is interpreted according to the new,
+     *    attribute-based syntax.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 6; + */ + @java.lang.Override + public /* nullable */ com.google.protobuf.Value getParamsOrDefault( + java.lang.String key, + /* nullable */ + 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 recommendations.
+     *
+     * Allowed values:
+     *
+     * * `returnDocument`: Boolean. If set to true, the associated Document
+     *    object will be returned in
+     *    [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.document].
+     * * `returnScore`: Boolean. If set to true, the recommendation 'score'
+     *    corresponding to each returned Document will be set in
+     *    [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.metadata].
+     *    The given 'score' indicates the probability of a Document conversion
+     *    given the user's context and history.
+     * * `strictFiltering`: Boolean. True by default. If set to false, the service
+     *    will return generic (unfiltered) popular Documents instead of empty if
+     *    your filter blocks all recommendation results.
+     * * `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 recommendation results
+     *    based on Document category.
+     * * `attributeFilteringSyntax`: Boolean. False by default. If set to true,
+     *    the `filter` field is interpreted according to the new,
+     *    attribute-based syntax.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 6; + */ + @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() { + bitField0_ = (bitField0_ & ~0x00000020); + internalGetMutableParams().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Additional domain specific parameters for the recommendations.
+     *
+     * Allowed values:
+     *
+     * * `returnDocument`: Boolean. If set to true, the associated Document
+     *    object will be returned in
+     *    [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.document].
+     * * `returnScore`: Boolean. If set to true, the recommendation 'score'
+     *    corresponding to each returned Document will be set in
+     *    [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.metadata].
+     *    The given 'score' indicates the probability of a Document conversion
+     *    given the user's context and history.
+     * * `strictFiltering`: Boolean. True by default. If set to false, the service
+     *    will return generic (unfiltered) popular Documents instead of empty if
+     *    your filter blocks all recommendation results.
+     * * `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 recommendation results
+     *    based on Document category.
+     * * `attributeFilteringSyntax`: Boolean. False by default. If set to true,
+     *    the `filter` field is interpreted according to the new,
+     *    attribute-based syntax.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 6; + */ + 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() { + bitField0_ |= 0x00000020; + return internalGetMutableParams().getMutableMap(); + } + /** + * + * + *
+     * Additional domain specific parameters for the recommendations.
+     *
+     * Allowed values:
+     *
+     * * `returnDocument`: Boolean. If set to true, the associated Document
+     *    object will be returned in
+     *    [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.document].
+     * * `returnScore`: Boolean. If set to true, the recommendation 'score'
+     *    corresponding to each returned Document will be set in
+     *    [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.metadata].
+     *    The given 'score' indicates the probability of a Document conversion
+     *    given the user's context and history.
+     * * `strictFiltering`: Boolean. True by default. If set to false, the service
+     *    will return generic (unfiltered) popular Documents instead of empty if
+     *    your filter blocks all recommendation results.
+     * * `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 recommendation results
+     *    based on Document category.
+     * * `attributeFilteringSyntax`: Boolean. False by default. If set to true,
+     *    the `filter` field is interpreted according to the new,
+     *    attribute-based syntax.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 6; + */ + 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); + bitField0_ |= 0x00000020; + return this; + } + /** + * + * + *
+     * Additional domain specific parameters for the recommendations.
+     *
+     * Allowed values:
+     *
+     * * `returnDocument`: Boolean. If set to true, the associated Document
+     *    object will be returned in
+     *    [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.document].
+     * * `returnScore`: Boolean. If set to true, the recommendation 'score'
+     *    corresponding to each returned Document will be set in
+     *    [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.metadata].
+     *    The given 'score' indicates the probability of a Document conversion
+     *    given the user's context and history.
+     * * `strictFiltering`: Boolean. True by default. If set to false, the service
+     *    will return generic (unfiltered) popular Documents instead of empty if
+     *    your filter blocks all recommendation results.
+     * * `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 recommendation results
+     *    based on Document category.
+     * * `attributeFilteringSyntax`: Boolean. False by default. If set to true,
+     *    the `filter` field is interpreted according to the new,
+     *    attribute-based syntax.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 6; + */ + public Builder putAllParams(java.util.Map values) { + internalGetMutableParams().getMutableMap().putAll(values); + bitField0_ |= 0x00000020; + return this; + } + + private com.google.protobuf.MapField userLabels_; + + private com.google.protobuf.MapField + internalGetUserLabels() { + if (userLabels_ == null) { + return com.google.protobuf.MapField.emptyMapField( + UserLabelsDefaultEntryHolder.defaultEntry); + } + return userLabels_; + } + + private com.google.protobuf.MapField + internalGetMutableUserLabels() { + if (userLabels_ == null) { + userLabels_ = + com.google.protobuf.MapField.newMapField(UserLabelsDefaultEntryHolder.defaultEntry); + } + if (!userLabels_.isMutable()) { + userLabels_ = userLabels_.copy(); + } + bitField0_ |= 0x00000040; + onChanged(); + return userLabels_; + } + + public int getUserLabelsCount() { + return internalGetUserLabels().getMap().size(); + } + /** + * + * + *
+     * The user 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 [Requirements for
+     * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> user_labels = 8; + */ + @java.lang.Override + public boolean containsUserLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetUserLabels().getMap().containsKey(key); + } + /** Use {@link #getUserLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getUserLabels() { + return getUserLabelsMap(); + } + /** + * + * + *
+     * The user 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 [Requirements for
+     * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> user_labels = 8; + */ + @java.lang.Override + public java.util.Map getUserLabelsMap() { + return internalGetUserLabels().getMap(); + } + /** + * + * + *
+     * The user 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 [Requirements for
+     * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> user_labels = 8; + */ + @java.lang.Override + public /* nullable */ java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The user 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 [Requirements for
+     * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> user_labels = 8; + */ + @java.lang.Override + public java.lang.String getUserLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearUserLabels() { + bitField0_ = (bitField0_ & ~0x00000040); + internalGetMutableUserLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * The user 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 [Requirements for
+     * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> user_labels = 8; + */ + public Builder removeUserLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableUserLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableUserLabels() { + bitField0_ |= 0x00000040; + return internalGetMutableUserLabels().getMutableMap(); + } + /** + * + * + *
+     * The user 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 [Requirements for
+     * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> user_labels = 8; + */ + public Builder putUserLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableUserLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000040; + return this; + } + /** + * + * + *
+     * The user 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 [Requirements for
+     * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+     * for more details.
+     * 
+ * + * map<string, string> user_labels = 8; + */ + public Builder putAllUserLabels(java.util.Map values) { + internalGetMutableUserLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000040; + 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.discoveryengine.v1alpha.RecommendRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.RecommendRequest) + private static final com.google.cloud.discoveryengine.v1alpha.RecommendRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.RecommendRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RecommendRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecommendRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendRequestOrBuilder.java new file mode 100644 index 000000000000..b4173a69efad --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendRequestOrBuilder.java @@ -0,0 +1,583 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/recommendation_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface RecommendRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.RecommendRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of the format:
+   * `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*`
+   *
+   * Before you can request recommendations from your model, you must create at
+   * least one serving config  for it.
+   * 
+ * + * + * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The servingConfig. + */ + java.lang.String getServingConfig(); + /** + * + * + *
+   * Required. Full resource name of the format:
+   * `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*`
+   *
+   * Before you can request recommendations from your model, you must create at
+   * least one serving config  for it.
+   * 
+ * + * + * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for servingConfig. + */ + com.google.protobuf.ByteString getServingConfigBytes(); + + /** + * + * + *
+   * Required. Context about the user, what they are looking at and what action
+   * they took to trigger the Recommend 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.
+   *
+   * Don't set
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * or
+   * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+   * to the same fixed ID for different users. If you are trying to receive
+   * non-personalized recommendations (not recommended; this can negatively
+   * impact model performance), instead set
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * to a random unique ID and leave
+   * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+   * unset.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.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 Recommend 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.
+   *
+   * Don't set
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * or
+   * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+   * to the same fixed ID for different users. If you are trying to receive
+   * non-personalized recommendations (not recommended; this can negatively
+   * impact model performance), instead set
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * to a random unique ID and leave
+   * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+   * unset.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + com.google.cloud.discoveryengine.v1alpha.UserEvent getUserEvent(); + /** + * + * + *
+   * Required. Context about the user, what they are looking at and what action
+   * they took to trigger the Recommend 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.
+   *
+   * Don't set
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * or
+   * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+   * to the same fixed ID for different users. If you are trying to receive
+   * non-personalized recommendations (not recommended; this can negatively
+   * impact model performance), instead set
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * to a random unique ID and leave
+   * [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id]
+   * unset.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.discoveryengine.v1alpha.UserEventOrBuilder getUserEventOrBuilder(); + + /** + * + * + *
+   * Maximum number of results to return. Set this property
+   * to the number of recommendation 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(); + + /** + * + * + *
+   * Filter for restricting recommendation results with a length limit of 5,000
+   * characters. Currently, only filter expressions on the `filter_tags`
+   * attribute is supported.
+   *
+   *
+   * Examples:
+   *
+   *  * `(filter_tags: ANY("Red", "Blue") OR filter_tags: ANY("Hot", "Cold"))`
+   *  * `(filter_tags: ANY("Red", "Blue")) AND NOT (filter_tags: ANY("Green"))`
+   *
+   * If `attributeFilteringSyntax` is set to true under the `params` field, then
+   * attribute-based expressions are expected instead of the above described
+   * tag-based syntax. Examples:
+   *
+   *  * (launguage: ANY("en", "es")) AND NOT (categories: ANY("Movie"))
+   *  * (available: true) AND
+   *    (launguage: ANY("en", "es")) OR (categories: ANY("Movie"))
+   *
+   * If your filter blocks all results, the API will return generic
+   * (unfiltered) popular Documents. If you only want results strictly matching
+   * the filters, set `strictFiltering` to True in
+   * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params]
+   * to receive empty results instead.
+   *
+   * Note that the API will never return
+   * [Document][google.cloud.discoveryengine.v1alpha.Document]s with
+   * `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Filter for restricting recommendation results with a length limit of 5,000
+   * characters. Currently, only filter expressions on the `filter_tags`
+   * attribute is supported.
+   *
+   *
+   * Examples:
+   *
+   *  * `(filter_tags: ANY("Red", "Blue") OR filter_tags: ANY("Hot", "Cold"))`
+   *  * `(filter_tags: ANY("Red", "Blue")) AND NOT (filter_tags: ANY("Green"))`
+   *
+   * If `attributeFilteringSyntax` is set to true under the `params` field, then
+   * attribute-based expressions are expected instead of the above described
+   * tag-based syntax. Examples:
+   *
+   *  * (launguage: ANY("en", "es")) AND NOT (categories: ANY("Movie"))
+   *  * (available: true) AND
+   *    (launguage: ANY("en", "es")) OR (categories: ANY("Movie"))
+   *
+   * If your filter blocks all results, the API will return generic
+   * (unfiltered) popular Documents. If you only want results strictly matching
+   * the filters, set `strictFiltering` to True in
+   * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params]
+   * to receive empty results instead.
+   *
+   * Note that the API will never return
+   * [Document][google.cloud.discoveryengine.v1alpha.Document]s with
+   * `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Use validate only mode for this recommendation query. If set to true, a
+   * fake model will be used that returns arbitrary Document IDs.
+   * Note that the validate only mode should only be used for testing the API,
+   * or if the model is not ready.
+   * 
+ * + * bool validate_only = 5; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Additional domain specific parameters for the recommendations.
+   *
+   * Allowed values:
+   *
+   * * `returnDocument`: Boolean. If set to true, the associated Document
+   *    object will be returned in
+   *    [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.document].
+   * * `returnScore`: Boolean. If set to true, the recommendation 'score'
+   *    corresponding to each returned Document will be set in
+   *    [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.metadata].
+   *    The given 'score' indicates the probability of a Document conversion
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular Documents instead of empty if
+   *    your filter blocks all recommendation results.
+   * * `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 recommendation results
+   *    based on Document category.
+   * * `attributeFilteringSyntax`: Boolean. False by default. If set to true,
+   *    the `filter` field is interpreted according to the new,
+   *    attribute-based syntax.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 6; + */ + int getParamsCount(); + /** + * + * + *
+   * Additional domain specific parameters for the recommendations.
+   *
+   * Allowed values:
+   *
+   * * `returnDocument`: Boolean. If set to true, the associated Document
+   *    object will be returned in
+   *    [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.document].
+   * * `returnScore`: Boolean. If set to true, the recommendation 'score'
+   *    corresponding to each returned Document will be set in
+   *    [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.metadata].
+   *    The given 'score' indicates the probability of a Document conversion
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular Documents instead of empty if
+   *    your filter blocks all recommendation results.
+   * * `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 recommendation results
+   *    based on Document category.
+   * * `attributeFilteringSyntax`: Boolean. False by default. If set to true,
+   *    the `filter` field is interpreted according to the new,
+   *    attribute-based syntax.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 6; + */ + boolean containsParams(java.lang.String key); + /** Use {@link #getParamsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getParams(); + /** + * + * + *
+   * Additional domain specific parameters for the recommendations.
+   *
+   * Allowed values:
+   *
+   * * `returnDocument`: Boolean. If set to true, the associated Document
+   *    object will be returned in
+   *    [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.document].
+   * * `returnScore`: Boolean. If set to true, the recommendation 'score'
+   *    corresponding to each returned Document will be set in
+   *    [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.metadata].
+   *    The given 'score' indicates the probability of a Document conversion
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular Documents instead of empty if
+   *    your filter blocks all recommendation results.
+   * * `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 recommendation results
+   *    based on Document category.
+   * * `attributeFilteringSyntax`: Boolean. False by default. If set to true,
+   *    the `filter` field is interpreted according to the new,
+   *    attribute-based syntax.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 6; + */ + java.util.Map getParamsMap(); + /** + * + * + *
+   * Additional domain specific parameters for the recommendations.
+   *
+   * Allowed values:
+   *
+   * * `returnDocument`: Boolean. If set to true, the associated Document
+   *    object will be returned in
+   *    [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.document].
+   * * `returnScore`: Boolean. If set to true, the recommendation 'score'
+   *    corresponding to each returned Document will be set in
+   *    [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.metadata].
+   *    The given 'score' indicates the probability of a Document conversion
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular Documents instead of empty if
+   *    your filter blocks all recommendation results.
+   * * `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 recommendation results
+   *    based on Document category.
+   * * `attributeFilteringSyntax`: Boolean. False by default. If set to true,
+   *    the `filter` field is interpreted according to the new,
+   *    attribute-based syntax.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 6; + */ + /* nullable */ + com.google.protobuf.Value getParamsOrDefault( + java.lang.String key, + /* nullable */ + com.google.protobuf.Value defaultValue); + /** + * + * + *
+   * Additional domain specific parameters for the recommendations.
+   *
+   * Allowed values:
+   *
+   * * `returnDocument`: Boolean. If set to true, the associated Document
+   *    object will be returned in
+   *    [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.document].
+   * * `returnScore`: Boolean. If set to true, the recommendation 'score'
+   *    corresponding to each returned Document will be set in
+   *    [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.metadata].
+   *    The given 'score' indicates the probability of a Document conversion
+   *    given the user's context and history.
+   * * `strictFiltering`: Boolean. True by default. If set to false, the service
+   *    will return generic (unfiltered) popular Documents instead of empty if
+   *    your filter blocks all recommendation results.
+   * * `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 recommendation results
+   *    based on Document category.
+   * * `attributeFilteringSyntax`: Boolean. False by default. If set to true,
+   *    the `filter` field is interpreted according to the new,
+   *    attribute-based syntax.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 6; + */ + com.google.protobuf.Value getParamsOrThrow(java.lang.String key); + + /** + * + * + *
+   * The user 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 [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 8; + */ + int getUserLabelsCount(); + /** + * + * + *
+   * The user 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 [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 8; + */ + boolean containsUserLabels(java.lang.String key); + /** Use {@link #getUserLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getUserLabels(); + /** + * + * + *
+   * The user 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 [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 8; + */ + java.util.Map getUserLabelsMap(); + /** + * + * + *
+   * The user 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 [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 8; + */ + /* nullable */ + java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * The user 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 [Requirements for
+   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
+   * for more details.
+   * 
+ * + * map<string, string> user_labels = 8; + */ + java.lang.String getUserLabelsOrThrow(java.lang.String key); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendResponse.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendResponse.java new file mode 100644 index 000000000000..2b4acbf5a94f --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendResponse.java @@ -0,0 +1,3138 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/recommendation_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Response message for Recommend method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.RecommendResponse} + */ +public final class RecommendResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.RecommendResponse) + RecommendResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use RecommendResponse.newBuilder() to construct. + private RecommendResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RecommendResponse() { + results_ = java.util.Collections.emptyList(); + attributionToken_ = ""; + missingIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RecommendResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.RecommendationServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.RecommendationServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.class, + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.Builder.class); + } + + public interface RecommendationResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Resource ID of the recommended Document.
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+     * Resource ID of the recommended Document.
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+     * Set if `returnDocument` is set to true in
+     * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + * + * @return Whether the document field is set. + */ + boolean hasDocument(); + /** + * + * + *
+     * Set if `returnDocument` is set to true in
+     * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + * + * @return The document. + */ + com.google.cloud.discoveryengine.v1alpha.Document getDocument(); + /** + * + * + *
+     * Set if `returnDocument` is set to true in
+     * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + */ + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder getDocumentOrBuilder(); + + /** + * + * + *
+     * Additional Document metadata / annotations.
+     *
+     * Possible values:
+     *
+     * * `score`: Recommendation score in double value. Is set if
+     *   `returnScore` is set to true in
+     *   [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 3; + */ + int getMetadataCount(); + /** + * + * + *
+     * Additional Document metadata / annotations.
+     *
+     * Possible values:
+     *
+     * * `score`: Recommendation score in double value. Is set if
+     *   `returnScore` is set to true in
+     *   [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 3; + */ + boolean containsMetadata(java.lang.String key); + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Deprecated + java.util.Map getMetadata(); + /** + * + * + *
+     * Additional Document metadata / annotations.
+     *
+     * Possible values:
+     *
+     * * `score`: Recommendation score in double value. Is set if
+     *   `returnScore` is set to true in
+     *   [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 3; + */ + java.util.Map getMetadataMap(); + /** + * + * + *
+     * Additional Document metadata / annotations.
+     *
+     * Possible values:
+     *
+     * * `score`: Recommendation score in double value. Is set if
+     *   `returnScore` is set to true in
+     *   [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 3; + */ + /* nullable */ + com.google.protobuf.Value getMetadataOrDefault( + java.lang.String key, + /* nullable */ + com.google.protobuf.Value defaultValue); + /** + * + * + *
+     * Additional Document metadata / annotations.
+     *
+     * Possible values:
+     *
+     * * `score`: Recommendation score in double value. Is set if
+     *   `returnScore` is set to true in
+     *   [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 3; + */ + com.google.protobuf.Value getMetadataOrThrow(java.lang.String key); + } + /** + * + * + *
+   * RecommendationResult represents a generic recommendation result with
+   * associated metadata.
+   * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult} + */ + public static final class RecommendationResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult) + RecommendationResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use RecommendationResult.newBuilder() to construct. + private RecommendationResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RecommendationResult() { + id_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RecommendationResult(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.RecommendationServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_RecommendationResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 3: + 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.discoveryengine.v1alpha.RecommendationServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_RecommendationResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.class, + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + .Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * + * + *
+     * Resource ID of the recommended Document.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Resource ID of the recommended Document.
+     * 
+ * + * 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 DOCUMENT_FIELD_NUMBER = 2; + private com.google.cloud.discoveryengine.v1alpha.Document document_; + /** + * + * + *
+     * Set if `returnDocument` is set to true in
+     * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + * + * @return Whether the document field is set. + */ + @java.lang.Override + public boolean hasDocument() { + return document_ != null; + } + /** + * + * + *
+     * Set if `returnDocument` is set to true in
+     * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + * + * @return The document. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Document getDocument() { + return document_ == null + ? com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance() + : document_; + } + /** + * + * + *
+     * Set if `returnDocument` is set to true in
+     * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder getDocumentOrBuilder() { + return document_ == null + ? com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance() + : document_; + } + + public static final int METADATA_FIELD_NUMBER = 3; + + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.discoveryengine.v1alpha.RecommendationServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_RecommendationResult_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.Value.getDefaultInstance()); + } + + @SuppressWarnings("serial") + 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 Document metadata / annotations.
+     *
+     * Possible values:
+     *
+     * * `score`: Recommendation score in double value. Is set if
+     *   `returnScore` is set to true in
+     *   [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 3; + */ + @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 Document metadata / annotations.
+     *
+     * Possible values:
+     *
+     * * `score`: Recommendation score in double value. Is set if
+     *   `returnScore` is set to true in
+     *   [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 3; + */ + @java.lang.Override + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + * + * + *
+     * Additional Document metadata / annotations.
+     *
+     * Possible values:
+     *
+     * * `score`: Recommendation score in double value. Is set if
+     *   `returnScore` is set to true in
+     *   [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 3; + */ + @java.lang.Override + public /* nullable */ com.google.protobuf.Value getMetadataOrDefault( + java.lang.String key, + /* nullable */ + 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 Document metadata / annotations.
+     *
+     * Possible values:
+     *
+     * * `score`: Recommendation score in double value. Is set if
+     *   `returnScore` is set to true in
+     *   [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+     * 
+ * + * map<string, .google.protobuf.Value> metadata = 3; + */ + @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_); + } + if (document_ != null) { + output.writeMessage(2, getDocument()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetMetadata(), MetadataDefaultEntryHolder.defaultEntry, 3); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (document_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDocument()); + } + 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(3, metadata__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult other = + (com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult) obj; + + if (!getId().equals(other.getId())) return false; + if (hasDocument() != other.hasDocument()) return false; + if (hasDocument()) { + if (!getDocument().equals(other.getDocument())) return false; + } + if (!internalGetMetadata().equals(other.internalGetMetadata())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + if (hasDocument()) { + hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getDocument().hashCode(); + } + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * RecommendationResult represents a generic recommendation result with
+     * associated metadata.
+     * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult) + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.RecommendationServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_RecommendationResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 3: + return internalGetMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 3: + 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.discoveryengine.v1alpha.RecommendationServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_RecommendationResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + .class, + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + .Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + document_ = null; + if (documentBuilder_ != null) { + documentBuilder_.dispose(); + documentBuilder_ = null; + } + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.RecommendationServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_RecommendationResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + build() { + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + buildPartial() { + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult result = + new com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.document_ = documentBuilder_ == null ? document_ : documentBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + .getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasDocument()) { + mergeDocument(other.getDocument()); + } + internalGetMutableMetadata().mergeFrom(other.internalGetMetadata()); + bitField0_ |= 0x00000004; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.protobuf.MapEntry + metadata__ = + input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableMetadata() + .getMutableMap() + .put(metadata__.getKey(), metadata__.getValue()); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * + * + *
+       * Resource ID of the recommended Document.
+       * 
+ * + * 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; + } + } + /** + * + * + *
+       * Resource ID of the recommended Document.
+       * 
+ * + * 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; + } + } + /** + * + * + *
+       * Resource ID of the recommended Document.
+       * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Resource ID of the recommended Document.
+       * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Resource ID of the recommended Document.
+       * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1alpha.Document document_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Document, + com.google.cloud.discoveryengine.v1alpha.Document.Builder, + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder> + documentBuilder_; + /** + * + * + *
+       * Set if `returnDocument` is set to true in
+       * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + * + * @return Whether the document field is set. + */ + public boolean hasDocument() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * Set if `returnDocument` is set to true in
+       * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + * + * @return The document. + */ + public com.google.cloud.discoveryengine.v1alpha.Document getDocument() { + if (documentBuilder_ == null) { + return document_ == null + ? com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance() + : document_; + } else { + return documentBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Set if `returnDocument` is set to true in
+       * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + */ + public Builder setDocument(com.google.cloud.discoveryengine.v1alpha.Document value) { + if (documentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + document_ = value; + } else { + documentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Set if `returnDocument` is set to true in
+       * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + */ + public Builder setDocument( + com.google.cloud.discoveryengine.v1alpha.Document.Builder builderForValue) { + if (documentBuilder_ == null) { + document_ = builderForValue.build(); + } else { + documentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Set if `returnDocument` is set to true in
+       * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + */ + public Builder mergeDocument(com.google.cloud.discoveryengine.v1alpha.Document value) { + if (documentBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && document_ != null + && document_ + != com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance()) { + getDocumentBuilder().mergeFrom(value); + } else { + document_ = value; + } + } else { + documentBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Set if `returnDocument` is set to true in
+       * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + */ + public Builder clearDocument() { + bitField0_ = (bitField0_ & ~0x00000002); + document_ = null; + if (documentBuilder_ != null) { + documentBuilder_.dispose(); + documentBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Set if `returnDocument` is set to true in
+       * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.Document.Builder getDocumentBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getDocumentFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Set if `returnDocument` is set to true in
+       * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder getDocumentOrBuilder() { + if (documentBuilder_ != null) { + return documentBuilder_.getMessageOrBuilder(); + } else { + return document_ == null + ? com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance() + : document_; + } + } + /** + * + * + *
+       * Set if `returnDocument` is set to true in
+       * [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Document, + com.google.cloud.discoveryengine.v1alpha.Document.Builder, + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder> + getDocumentFieldBuilder() { + if (documentBuilder_ == null) { + documentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Document, + com.google.cloud.discoveryengine.v1alpha.Document.Builder, + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder>( + getDocument(), getParentForChildren(), isClean()); + document_ = null; + } + return documentBuilder_; + } + + 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() { + if (metadata_ == null) { + metadata_ = + com.google.protobuf.MapField.newMapField(MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + bitField0_ |= 0x00000004; + onChanged(); + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + * + * + *
+       * Additional Document metadata / annotations.
+       *
+       * Possible values:
+       *
+       * * `score`: Recommendation score in double value. Is set if
+       *   `returnScore` is set to true in
+       *   [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+       * 
+ * + * map<string, .google.protobuf.Value> metadata = 3; + */ + @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 Document metadata / annotations.
+       *
+       * Possible values:
+       *
+       * * `score`: Recommendation score in double value. Is set if
+       *   `returnScore` is set to true in
+       *   [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+       * 
+ * + * map<string, .google.protobuf.Value> metadata = 3; + */ + @java.lang.Override + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + * + * + *
+       * Additional Document metadata / annotations.
+       *
+       * Possible values:
+       *
+       * * `score`: Recommendation score in double value. Is set if
+       *   `returnScore` is set to true in
+       *   [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+       * 
+ * + * map<string, .google.protobuf.Value> metadata = 3; + */ + @java.lang.Override + public /* nullable */ com.google.protobuf.Value getMetadataOrDefault( + java.lang.String key, + /* nullable */ + 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 Document metadata / annotations.
+       *
+       * Possible values:
+       *
+       * * `score`: Recommendation score in double value. Is set if
+       *   `returnScore` is set to true in
+       *   [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+       * 
+ * + * map<string, .google.protobuf.Value> metadata = 3; + */ + @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() { + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableMetadata().getMutableMap().clear(); + return this; + } + /** + * + * + *
+       * Additional Document metadata / annotations.
+       *
+       * Possible values:
+       *
+       * * `score`: Recommendation score in double value. Is set if
+       *   `returnScore` is set to true in
+       *   [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+       * 
+ * + * map<string, .google.protobuf.Value> metadata = 3; + */ + 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() { + bitField0_ |= 0x00000004; + return internalGetMutableMetadata().getMutableMap(); + } + /** + * + * + *
+       * Additional Document metadata / annotations.
+       *
+       * Possible values:
+       *
+       * * `score`: Recommendation score in double value. Is set if
+       *   `returnScore` is set to true in
+       *   [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+       * 
+ * + * map<string, .google.protobuf.Value> metadata = 3; + */ + 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); + bitField0_ |= 0x00000004; + return this; + } + /** + * + * + *
+       * Additional Document metadata / annotations.
+       *
+       * Possible values:
+       *
+       * * `score`: Recommendation score in double value. Is set if
+       *   `returnScore` is set to true in
+       *   [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params].
+       * 
+ * + * map<string, .google.protobuf.Value> metadata = 3; + */ + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap().putAll(values); + bitField0_ |= 0x00000004; + 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.discoveryengine.v1alpha.RecommendResponse.RecommendationResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult) + private static final com.google.cloud.discoveryengine.v1alpha.RecommendResponse + .RecommendationResult + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult(); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RecommendationResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int RESULTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List< + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult> + results_; + /** + * + * + *
+   * A list of recommended Documents. The order represents the ranking (from the
+   * most relevant Document to the least).
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + @java.lang.Override + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult> + getResultsList() { + return results_; + } + /** + * + * + *
+   * A list of recommended Documents. The order represents the ranking (from the
+   * most relevant Document to the least).
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.RecommendResponse + .RecommendationResultOrBuilder> + getResultsOrBuilderList() { + return results_; + } + /** + * + * + *
+   * A list of recommended Documents. The order represents the ranking (from the
+   * most relevant Document to the least).
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + @java.lang.Override + public int getResultsCount() { + return results_.size(); + } + /** + * + * + *
+   * A list of recommended Documents. The order represents the ranking (from the
+   * most relevant Document to the least).
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult getResults( + int index) { + return results_.get(index); + } + /** + * + * + *
+   * A list of recommended Documents. The order represents the ranking (from the
+   * most relevant Document to the least).
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResultOrBuilder + getResultsOrBuilder(int index) { + return results_.get(index); + } + + public static final int ATTRIBUTION_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object attributionToken_ = ""; + /** + * + * + *
+   * A unique attribution token. This should be included in the
+   * [UserEvent][google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList missingIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * IDs of documents in the request that were missing from the default Branch
+   * associated with the requested ServingConfig.
+   * 
+ * + * repeated string missing_ids = 3; + * + * @return A list containing the missingIds. + */ + public com.google.protobuf.ProtocolStringList getMissingIdsList() { + return missingIds_; + } + /** + * + * + *
+   * IDs of documents in the request that were missing from the default Branch
+   * associated with the requested ServingConfig.
+   * 
+ * + * repeated string missing_ids = 3; + * + * @return The count of missingIds. + */ + public int getMissingIdsCount() { + return missingIds_.size(); + } + /** + * + * + *
+   * IDs of documents in the request that were missing from the default Branch
+   * associated with the requested ServingConfig.
+   * 
+ * + * 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 documents in the request that were missing from the default Branch
+   * associated with the requested ServingConfig.
+   * 
+ * + * 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_ = false; + /** + * + * + *
+   * True if
+   * [RecommendRequest.validate_only][google.cloud.discoveryengine.v1alpha.RecommendRequest.validate_only]
+   * was set.
+   * 
+ * + * 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_); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.RecommendResponse)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.RecommendResponse other = + (com.google.cloud.discoveryengine.v1alpha.RecommendResponse) 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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.RecommendResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 Recommend method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.RecommendResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.RecommendResponse) + com.google.cloud.discoveryengine.v1alpha.RecommendResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.RecommendationServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.RecommendationServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.class, + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.RecommendResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + } else { + results_ = null; + resultsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + attributionToken_ = ""; + missingIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.RecommendationServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecommendResponse getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.RecommendResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecommendResponse build() { + com.google.cloud.discoveryengine.v1alpha.RecommendResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecommendResponse buildPartial() { + com.google.cloud.discoveryengine.v1alpha.RecommendResponse result = + new com.google.cloud.discoveryengine.v1alpha.RecommendResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.RecommendResponse result) { + if (resultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.results_ = results_; + } else { + result.results_ = resultsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.RecommendResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.attributionToken_ = attributionToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + missingIds_.makeImmutable(); + result.missingIds_ = missingIds_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.RecommendResponse) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.RecommendResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.RecommendResponse other) { + if (other == com.google.cloud.discoveryengine.v1alpha.RecommendResponse.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_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.missingIds_.isEmpty()) { + if (missingIds_.isEmpty()) { + missingIds_ = other.missingIds_; + bitField0_ |= 0x00000004; + } else { + ensureMissingIdsIsMutable(); + missingIds_.addAll(other.missingIds_); + } + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.RecommendResponse + .RecommendationResult.parser(), + extensionRegistry); + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(m); + } else { + resultsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + attributionToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureMissingIdsIsMutable(); + missingIds_.add(s); + break; + } // case 26 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List< + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult> + results_ = java.util.Collections.emptyList(); + + private void ensureResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + results_ = + new java.util.ArrayList< + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult>( + results_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult, + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.Builder, + com.google.cloud.discoveryengine.v1alpha.RecommendResponse + .RecommendationResultOrBuilder> + resultsBuilder_; + + /** + * + * + *
+     * A list of recommended Documents. The order represents the ranking (from the
+     * most relevant Document to the least).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult> + getResultsList() { + if (resultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(results_); + } else { + return resultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of recommended Documents. The order represents the ranking (from the
+     * most relevant Document to the least).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + public int getResultsCount() { + if (resultsBuilder_ == null) { + return results_.size(); + } else { + return resultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of recommended Documents. The order represents the ranking (from the
+     * most relevant Document to the least).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + getResults(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of recommended Documents. The order represents the ranking (from the
+     * most relevant Document to the least).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + public Builder setResults( + int index, + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult 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 Documents. The order represents the ranking (from the
+     * most relevant Document to the least).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + public Builder setResults( + int index, + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.Builder + builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.set(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of recommended Documents. The order represents the ranking (from the
+     * most relevant Document to the least).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + public Builder addResults( + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult 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 Documents. The order represents the ranking (from the
+     * most relevant Document to the least).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + public Builder addResults( + int index, + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult 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 Documents. The order represents the ranking (from the
+     * most relevant Document to the least).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + public Builder addResults( + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.Builder + builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of recommended Documents. The order represents the ranking (from the
+     * most relevant Document to the least).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + public Builder addResults( + int index, + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.Builder + builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of recommended Documents. The order represents the ranking (from the
+     * most relevant Document to the least).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + public Builder addAllResults( + java.lang.Iterable< + ? extends + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult> + values) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); + onChanged(); + } else { + resultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of recommended Documents. The order represents the ranking (from the
+     * most relevant Document to the least).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult 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 Documents. The order represents the ranking (from the
+     * most relevant Document to the least).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult 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 Documents. The order represents the ranking (from the
+     * most relevant Document to the least).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.Builder + getResultsBuilder(int index) { + return getResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of recommended Documents. The order represents the ranking (from the
+     * most relevant Document to the least).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResultOrBuilder + getResultsOrBuilder(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of recommended Documents. The order represents the ranking (from the
+     * most relevant Document to the least).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.RecommendResponse + .RecommendationResultOrBuilder> + getResultsOrBuilderList() { + if (resultsBuilder_ != null) { + return resultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(results_); + } + } + /** + * + * + *
+     * A list of recommended Documents. The order represents the ranking (from the
+     * most relevant Document to the least).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.Builder + addResultsBuilder() { + return getResultsFieldBuilder() + .addBuilder( + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + .getDefaultInstance()); + } + /** + * + * + *
+     * A list of recommended Documents. The order represents the ranking (from the
+     * most relevant Document to the least).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.Builder + addResultsBuilder(int index) { + return getResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + .getDefaultInstance()); + } + /** + * + * + *
+     * A list of recommended Documents. The order represents the ranking (from the
+     * most relevant Document to the least).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.Builder> + getResultsBuilderList() { + return getResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult, + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.Builder, + com.google.cloud.discoveryengine.v1alpha.RecommendResponse + .RecommendationResultOrBuilder> + getResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult, + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult + .Builder, + com.google.cloud.discoveryengine.v1alpha.RecommendResponse + .RecommendationResultOrBuilder>( + 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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A unique attribution token. This should be included in the
+     * [UserEvent][google.cloud.discoveryengine.v1alpha.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(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A unique attribution token. This should be included in the
+     * [UserEvent][google.cloud.discoveryengine.v1alpha.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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList missingIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureMissingIdsIsMutable() { + if (!missingIds_.isModifiable()) { + missingIds_ = new com.google.protobuf.LazyStringArrayList(missingIds_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+     * IDs of documents in the request that were missing from the default Branch
+     * associated with the requested ServingConfig.
+     * 
+ * + * repeated string missing_ids = 3; + * + * @return A list containing the missingIds. + */ + public com.google.protobuf.ProtocolStringList getMissingIdsList() { + missingIds_.makeImmutable(); + return missingIds_; + } + /** + * + * + *
+     * IDs of documents in the request that were missing from the default Branch
+     * associated with the requested ServingConfig.
+     * 
+ * + * repeated string missing_ids = 3; + * + * @return The count of missingIds. + */ + public int getMissingIdsCount() { + return missingIds_.size(); + } + /** + * + * + *
+     * IDs of documents in the request that were missing from the default Branch
+     * associated with the requested ServingConfig.
+     * 
+ * + * 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 documents in the request that were missing from the default Branch
+     * associated with the requested ServingConfig.
+     * 
+ * + * 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 documents in the request that were missing from the default Branch
+     * associated with the requested ServingConfig.
+     * 
+ * + * 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); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * IDs of documents in the request that were missing from the default Branch
+     * associated with the requested ServingConfig.
+     * 
+ * + * 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); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * IDs of documents in the request that were missing from the default Branch
+     * associated with the requested ServingConfig.
+     * 
+ * + * 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_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * IDs of documents in the request that were missing from the default Branch
+     * associated with the requested ServingConfig.
+     * 
+ * + * repeated string missing_ids = 3; + * + * @return This builder for chaining. + */ + public Builder clearMissingIds() { + missingIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * IDs of documents in the request that were missing from the default Branch
+     * associated with the requested ServingConfig.
+     * 
+ * + * 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); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * True if
+     * [RecommendRequest.validate_only][google.cloud.discoveryengine.v1alpha.RecommendRequest.validate_only]
+     * was set.
+     * 
+ * + * bool validate_only = 4; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * True if
+     * [RecommendRequest.validate_only][google.cloud.discoveryengine.v1alpha.RecommendRequest.validate_only]
+     * was set.
+     * 
+ * + * bool validate_only = 4; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * True if
+     * [RecommendRequest.validate_only][google.cloud.discoveryengine.v1alpha.RecommendRequest.validate_only]
+     * was set.
+     * 
+ * + * bool validate_only = 4; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + 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.discoveryengine.v1alpha.RecommendResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.RecommendResponse) + private static final com.google.cloud.discoveryengine.v1alpha.RecommendResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.RecommendResponse(); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecommendResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RecommendResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecommendResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendResponseOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendResponseOrBuilder.java new file mode 100644 index 000000000000..aba8c9ca4a65 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendResponseOrBuilder.java @@ -0,0 +1,199 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/recommendation_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface RecommendResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.RecommendResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of recommended Documents. The order represents the ranking (from the
+   * most relevant Document to the least).
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + java.util.List + getResultsList(); + /** + * + * + *
+   * A list of recommended Documents. The order represents the ranking (from the
+   * most relevant Document to the least).
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult getResults( + int index); + /** + * + * + *
+   * A list of recommended Documents. The order represents the ranking (from the
+   * most relevant Document to the least).
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + int getResultsCount(); + /** + * + * + *
+   * A list of recommended Documents. The order represents the ranking (from the
+   * most relevant Document to the least).
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.RecommendResponse + .RecommendationResultOrBuilder> + getResultsOrBuilderList(); + /** + * + * + *
+   * A list of recommended Documents. The order represents the ranking (from the
+   * most relevant Document to the least).
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult results = 1; + * + */ + com.google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResultOrBuilder + getResultsOrBuilder(int index); + + /** + * + * + *
+   * A unique attribution token. This should be included in the
+   * [UserEvent][google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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 documents in the request that were missing from the default Branch
+   * associated with the requested ServingConfig.
+   * 
+ * + * repeated string missing_ids = 3; + * + * @return A list containing the missingIds. + */ + java.util.List getMissingIdsList(); + /** + * + * + *
+   * IDs of documents in the request that were missing from the default Branch
+   * associated with the requested ServingConfig.
+   * 
+ * + * repeated string missing_ids = 3; + * + * @return The count of missingIds. + */ + int getMissingIdsCount(); + /** + * + * + *
+   * IDs of documents in the request that were missing from the default Branch
+   * associated with the requested ServingConfig.
+   * 
+ * + * 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 documents in the request that were missing from the default Branch
+   * associated with the requested ServingConfig.
+   * 
+ * + * 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
+   * [RecommendRequest.validate_only][google.cloud.discoveryengine.v1alpha.RecommendRequest.validate_only]
+   * was set.
+   * 
+ * + * bool validate_only = 4; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceProto.java new file mode 100644 index 000000000000..f6d41866b4aa --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecommendationServiceProto.java @@ -0,0 +1,213 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/recommendation_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public final class RecommendationServiceProto { + private RecommendationServiceProto() {} + + 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_discoveryengine_v1alpha_RecommendRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_ParamsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_ParamsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_UserLabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_UserLabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_RecommendationResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_RecommendationResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_RecommendationResult_MetadataEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_RecommendationResult_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 = { + "\nAgoogle/cloud/discoveryengine/v1alpha/r" + + "ecommendation_service.proto\022$google.clou" + + "d.discoveryengine.v1alpha\032\034google/api/an" + + "notations.proto\032\027google/api/client.proto" + + "\032\037google/api/field_behavior.proto\032\031googl" + + "e/api/resource.proto\0323google/cloud/disco" + + "veryengine/v1alpha/document.proto\0325googl" + + "e/cloud/discoveryengine/v1alpha/user_eve" + + "nt.proto\032\034google/protobuf/struct.proto\"\221" + + "\004\n\020RecommendRequest\022M\n\016serving_config\030\001 " + + "\001(\tB5\342A\001\002\372A.\n,discoveryengine.googleapis" + + ".com/ServingConfig\022I\n\nuser_event\030\002 \001(\0132/" + + ".google.cloud.discoveryengine.v1alpha.Us" + + "erEventB\004\342A\001\002\022\021\n\tpage_size\030\003 \001(\005\022\016\n\006filt" + + "er\030\004 \001(\t\022\025\n\rvalidate_only\030\005 \001(\010\022R\n\006param" + + "s\030\006 \003(\0132B.google.cloud.discoveryengine.v" + + "1alpha.RecommendRequest.ParamsEntry\022[\n\013u" + + "ser_labels\030\010 \003(\0132F.google.cloud.discover" + + "yengine.v1alpha.RecommendRequest.UserLab" + + "elsEntry\032E\n\013ParamsEntry\022\013\n\003key\030\001 \001(\t\022%\n\005" + + "value\030\002 \001(\0132\026.google.protobuf.Value:\0028\001\032" + + "1\n\017UserLabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value" + + "\030\002 \001(\t:\0028\001\"\327\003\n\021RecommendResponse\022]\n\007resu" + + "lts\030\001 \003(\0132L.google.cloud.discoveryengine" + + ".v1alpha.RecommendResponse.Recommendatio" + + "nResult\022\031\n\021attribution_token\030\002 \001(\t\022\023\n\013mi" + + "ssing_ids\030\003 \003(\t\022\025\n\rvalidate_only\030\004 \001(\010\032\233" + + "\002\n\024RecommendationResult\022\n\n\002id\030\001 \001(\t\022@\n\010d" + + "ocument\030\002 \001(\0132..google.cloud.discoveryen" + + "gine.v1alpha.Document\022l\n\010metadata\030\003 \003(\0132" + + "Z.google.cloud.discoveryengine.v1alpha.R" + + "ecommendResponse.RecommendationResult.Me" + + "tadataEntry\032G\n\rMetadataEntry\022\013\n\003key\030\001 \001(" + + "\t\022%\n\005value\030\002 \001(\0132\026.google.protobuf.Value" + + ":\0028\0012\250\004\n\025RecommendationService\022\272\003\n\tRecom" + + "mend\0226.google.cloud.discoveryengine.v1al" + + "pha.RecommendRequest\0327.google.cloud.disc" + + "overyengine.v1alpha.RecommendResponse\"\273\002" + + "\202\323\344\223\002\264\002\"X/v1alpha/{serving_config=projec" + + "ts/*/locations/*/dataStores/*/servingCon" + + "figs/*}:recommend:\001*Zk\"f/v1alpha/{servin" + + "g_config=projects/*/locations/*/collecti" + + "ons/*/dataStores/*/servingConfigs/*}:rec" + + "ommend:\001*Zh\"c/v1alpha/{serving_config=pr" + + "ojects/*/locations/*/collections/*/engin" + + "es/*/servingConfigs/*}:recommend:\001*\032R\312A\036" + + "discoveryengine.googleapis.com\322A.https:/" + + "/www.googleapis.com/auth/cloud-platformB" + + "\246\002\n(com.google.cloud.discoveryengine.v1a" + + "lphaB\032RecommendationServiceProtoP\001ZRclou" + + "d.google.com/go/discoveryengine/apiv1alp" + + "ha/discoveryenginepb;discoveryenginepb\242\002" + + "\017DISCOVERYENGINE\252\002$Google.Cloud.Discover" + + "yEngine.V1Alpha\312\002$Google\\Cloud\\Discovery" + + "Engine\\V1alpha\352\002\'Google::Cloud::Discover" + + "yEngine::V1alphab\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.discoveryengine.v1alpha.DocumentProto.getDescriptor(), + com.google.cloud.discoveryengine.v1alpha.UserEventProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + }); + internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_descriptor, + new java.lang.String[] { + "ServingConfig", + "UserEvent", + "PageSize", + "Filter", + "ValidateOnly", + "Params", + "UserLabels", + }); + internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_ParamsEntry_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_ParamsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_ParamsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_UserLabelsEntry_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_UserLabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_RecommendRequest_UserLabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_descriptor, + new java.lang.String[] { + "Results", "AttributionToken", "MissingIds", "ValidateOnly", + }); + internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_RecommendationResult_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_RecommendationResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_RecommendationResult_descriptor, + new java.lang.String[] { + "Id", "Document", "Metadata", + }); + internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_RecommendationResult_MetadataEntry_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_RecommendationResult_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_RecommendationResult_MetadataEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_RecommendResponse_RecommendationResult_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); + 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.discoveryengine.v1alpha.DocumentProto.getDescriptor(); + com.google.cloud.discoveryengine.v1alpha.UserEventProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisMetadata.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisMetadata.java new file mode 100644 index 000000000000..143ea9158d5c --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisMetadata.java @@ -0,0 +1,1664 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/site_search_engine_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Metadata related to the progress of the
+ * [SiteSearchEngineService.RecrawlUris][google.cloud.discoveryengine.v1alpha.SiteSearchEngineService.RecrawlUris]
+ * operation. This will be returned by the google.longrunning.Operation.metadata
+ * field.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata} + */ +public final class RecrawlUrisMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata) + RecrawlUrisMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use RecrawlUrisMetadata.newBuilder() to construct. + private RecrawlUrisMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RecrawlUrisMetadata() { + invalidUris_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RecrawlUrisMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata.class, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata.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 createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + 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 updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int INVALID_URIS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList invalidUris_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Unique URIs in the request that don't match any TargetSite in the
+   * DataStore, only match TargetSites that haven't been fully indexed, or match
+   * a TargetSite with type EXCLUDE.
+   * 
+ * + * repeated string invalid_uris = 3; + * + * @return A list containing the invalidUris. + */ + public com.google.protobuf.ProtocolStringList getInvalidUrisList() { + return invalidUris_; + } + /** + * + * + *
+   * Unique URIs in the request that don't match any TargetSite in the
+   * DataStore, only match TargetSites that haven't been fully indexed, or match
+   * a TargetSite with type EXCLUDE.
+   * 
+ * + * repeated string invalid_uris = 3; + * + * @return The count of invalidUris. + */ + public int getInvalidUrisCount() { + return invalidUris_.size(); + } + /** + * + * + *
+   * Unique URIs in the request that don't match any TargetSite in the
+   * DataStore, only match TargetSites that haven't been fully indexed, or match
+   * a TargetSite with type EXCLUDE.
+   * 
+ * + * repeated string invalid_uris = 3; + * + * @param index The index of the element to return. + * @return The invalidUris at the given index. + */ + public java.lang.String getInvalidUris(int index) { + return invalidUris_.get(index); + } + /** + * + * + *
+   * Unique URIs in the request that don't match any TargetSite in the
+   * DataStore, only match TargetSites that haven't been fully indexed, or match
+   * a TargetSite with type EXCLUDE.
+   * 
+ * + * repeated string invalid_uris = 3; + * + * @param index The index of the value to return. + * @return The bytes of the invalidUris at the given index. + */ + public com.google.protobuf.ByteString getInvalidUrisBytes(int index) { + return invalidUris_.getByteString(index); + } + + public static final int VALID_URIS_COUNT_FIELD_NUMBER = 4; + private int validUrisCount_ = 0; + /** + * + * + *
+   * Total number of unique URIs in the request that are not in invalid_uris.
+   * 
+ * + * int32 valid_uris_count = 4; + * + * @return The validUrisCount. + */ + @java.lang.Override + public int getValidUrisCount() { + return validUrisCount_; + } + + public static final int SUCCESS_COUNT_FIELD_NUMBER = 5; + private int successCount_ = 0; + /** + * + * + *
+   * Total number of URIs that have been crawled so far.
+   * 
+ * + * int32 success_count = 5; + * + * @return The successCount. + */ + @java.lang.Override + public int getSuccessCount() { + return successCount_; + } + + public static final int PENDING_COUNT_FIELD_NUMBER = 6; + private int pendingCount_ = 0; + /** + * + * + *
+   * Total number of URIs that have yet to be crawled.
+   * 
+ * + * int32 pending_count = 6; + * + * @return The pendingCount. + */ + @java.lang.Override + public int getPendingCount() { + return pendingCount_; + } + + public static final int QUOTA_EXCEEDED_COUNT_FIELD_NUMBER = 7; + private int quotaExceededCount_ = 0; + /** + * + * + *
+   * Total number of URIs that were rejected due to insufficient indexing
+   * resources.
+   * 
+ * + * int32 quota_exceeded_count = 7; + * + * @return The quotaExceededCount. + */ + @java.lang.Override + public int getQuotaExceededCount() { + return quotaExceededCount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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()); + } + for (int i = 0; i < invalidUris_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, invalidUris_.getRaw(i)); + } + if (validUrisCount_ != 0) { + output.writeInt32(4, validUrisCount_); + } + if (successCount_ != 0) { + output.writeInt32(5, successCount_); + } + if (pendingCount_ != 0) { + output.writeInt32(6, pendingCount_); + } + if (quotaExceededCount_ != 0) { + output.writeInt32(7, quotaExceededCount_); + } + getUnknownFields().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()); + } + { + int dataSize = 0; + for (int i = 0; i < invalidUris_.size(); i++) { + dataSize += computeStringSizeNoTag(invalidUris_.getRaw(i)); + } + size += dataSize; + size += 1 * getInvalidUrisList().size(); + } + if (validUrisCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, validUrisCount_); + } + if (successCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, successCount_); + } + if (pendingCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, pendingCount_); + } + if (quotaExceededCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, quotaExceededCount_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata other = + (com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata) 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 (!getInvalidUrisList().equals(other.getInvalidUrisList())) return false; + if (getValidUrisCount() != other.getValidUrisCount()) return false; + if (getSuccessCount() != other.getSuccessCount()) return false; + if (getPendingCount() != other.getPendingCount()) return false; + if (getQuotaExceededCount() != other.getQuotaExceededCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (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(); + } + if (getInvalidUrisCount() > 0) { + hash = (37 * hash) + INVALID_URIS_FIELD_NUMBER; + hash = (53 * hash) + getInvalidUrisList().hashCode(); + } + hash = (37 * hash) + VALID_URIS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getValidUrisCount(); + hash = (37 * hash) + SUCCESS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getSuccessCount(); + hash = (37 * hash) + PENDING_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getPendingCount(); + hash = (37 * hash) + QUOTA_EXCEEDED_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getQuotaExceededCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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
+   * [SiteSearchEngineService.RecrawlUris][google.cloud.discoveryengine.v1alpha.SiteSearchEngineService.RecrawlUris]
+   * operation. This will be returned by the google.longrunning.Operation.metadata
+   * field.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata) + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata.class, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + invalidUris_ = com.google.protobuf.LazyStringArrayList.emptyList(); + validUrisCount_ = 0; + successCount_ = 0; + pendingCount_ = 0; + quotaExceededCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata build() { + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata buildPartial() { + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata result = + new com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + invalidUris_.makeImmutable(); + result.invalidUris_ = invalidUris_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validUrisCount_ = validUrisCount_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.successCount_ = successCount_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.pendingCount_ = pendingCount_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.quotaExceededCount_ = quotaExceededCount_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (!other.invalidUris_.isEmpty()) { + if (invalidUris_.isEmpty()) { + invalidUris_ = other.invalidUris_; + bitField0_ |= 0x00000004; + } else { + ensureInvalidUrisIsMutable(); + invalidUris_.addAll(other.invalidUris_); + } + onChanged(); + } + if (other.getValidUrisCount() != 0) { + setValidUrisCount(other.getValidUrisCount()); + } + if (other.getSuccessCount() != 0) { + setSuccessCount(other.getSuccessCount()); + } + if (other.getPendingCount() != 0) { + setPendingCount(other.getPendingCount()); + } + if (other.getQuotaExceededCount() != 0) { + setQuotaExceededCount(other.getQuotaExceededCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureInvalidUrisIsMutable(); + invalidUris_.add(s); + break; + } // case 26 + case 32: + { + validUrisCount_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + successCount_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: + { + pendingCount_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: + { + quotaExceededCount_ = input.readInt32(); + bitField0_ |= 0x00000040; + break; + } // case 56 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private 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 ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * 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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + 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(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000001); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000001; + 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 ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * 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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + 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(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + 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 (((bitField0_ & 0x00000002) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + 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() { + bitField0_ = (bitField0_ & ~0x00000002); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + 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() { + bitField0_ |= 0x00000002; + 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 com.google.protobuf.LazyStringArrayList invalidUris_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureInvalidUrisIsMutable() { + if (!invalidUris_.isModifiable()) { + invalidUris_ = new com.google.protobuf.LazyStringArrayList(invalidUris_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+     * Unique URIs in the request that don't match any TargetSite in the
+     * DataStore, only match TargetSites that haven't been fully indexed, or match
+     * a TargetSite with type EXCLUDE.
+     * 
+ * + * repeated string invalid_uris = 3; + * + * @return A list containing the invalidUris. + */ + public com.google.protobuf.ProtocolStringList getInvalidUrisList() { + invalidUris_.makeImmutable(); + return invalidUris_; + } + /** + * + * + *
+     * Unique URIs in the request that don't match any TargetSite in the
+     * DataStore, only match TargetSites that haven't been fully indexed, or match
+     * a TargetSite with type EXCLUDE.
+     * 
+ * + * repeated string invalid_uris = 3; + * + * @return The count of invalidUris. + */ + public int getInvalidUrisCount() { + return invalidUris_.size(); + } + /** + * + * + *
+     * Unique URIs in the request that don't match any TargetSite in the
+     * DataStore, only match TargetSites that haven't been fully indexed, or match
+     * a TargetSite with type EXCLUDE.
+     * 
+ * + * repeated string invalid_uris = 3; + * + * @param index The index of the element to return. + * @return The invalidUris at the given index. + */ + public java.lang.String getInvalidUris(int index) { + return invalidUris_.get(index); + } + /** + * + * + *
+     * Unique URIs in the request that don't match any TargetSite in the
+     * DataStore, only match TargetSites that haven't been fully indexed, or match
+     * a TargetSite with type EXCLUDE.
+     * 
+ * + * repeated string invalid_uris = 3; + * + * @param index The index of the value to return. + * @return The bytes of the invalidUris at the given index. + */ + public com.google.protobuf.ByteString getInvalidUrisBytes(int index) { + return invalidUris_.getByteString(index); + } + /** + * + * + *
+     * Unique URIs in the request that don't match any TargetSite in the
+     * DataStore, only match TargetSites that haven't been fully indexed, or match
+     * a TargetSite with type EXCLUDE.
+     * 
+ * + * repeated string invalid_uris = 3; + * + * @param index The index to set the value at. + * @param value The invalidUris to set. + * @return This builder for chaining. + */ + public Builder setInvalidUris(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInvalidUrisIsMutable(); + invalidUris_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Unique URIs in the request that don't match any TargetSite in the
+     * DataStore, only match TargetSites that haven't been fully indexed, or match
+     * a TargetSite with type EXCLUDE.
+     * 
+ * + * repeated string invalid_uris = 3; + * + * @param value The invalidUris to add. + * @return This builder for chaining. + */ + public Builder addInvalidUris(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInvalidUrisIsMutable(); + invalidUris_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Unique URIs in the request that don't match any TargetSite in the
+     * DataStore, only match TargetSites that haven't been fully indexed, or match
+     * a TargetSite with type EXCLUDE.
+     * 
+ * + * repeated string invalid_uris = 3; + * + * @param values The invalidUris to add. + * @return This builder for chaining. + */ + public Builder addAllInvalidUris(java.lang.Iterable values) { + ensureInvalidUrisIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, invalidUris_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Unique URIs in the request that don't match any TargetSite in the
+     * DataStore, only match TargetSites that haven't been fully indexed, or match
+     * a TargetSite with type EXCLUDE.
+     * 
+ * + * repeated string invalid_uris = 3; + * + * @return This builder for chaining. + */ + public Builder clearInvalidUris() { + invalidUris_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Unique URIs in the request that don't match any TargetSite in the
+     * DataStore, only match TargetSites that haven't been fully indexed, or match
+     * a TargetSite with type EXCLUDE.
+     * 
+ * + * repeated string invalid_uris = 3; + * + * @param value The bytes of the invalidUris to add. + * @return This builder for chaining. + */ + public Builder addInvalidUrisBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureInvalidUrisIsMutable(); + invalidUris_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int validUrisCount_; + /** + * + * + *
+     * Total number of unique URIs in the request that are not in invalid_uris.
+     * 
+ * + * int32 valid_uris_count = 4; + * + * @return The validUrisCount. + */ + @java.lang.Override + public int getValidUrisCount() { + return validUrisCount_; + } + /** + * + * + *
+     * Total number of unique URIs in the request that are not in invalid_uris.
+     * 
+ * + * int32 valid_uris_count = 4; + * + * @param value The validUrisCount to set. + * @return This builder for chaining. + */ + public Builder setValidUrisCount(int value) { + + validUrisCount_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Total number of unique URIs in the request that are not in invalid_uris.
+     * 
+ * + * int32 valid_uris_count = 4; + * + * @return This builder for chaining. + */ + public Builder clearValidUrisCount() { + bitField0_ = (bitField0_ & ~0x00000008); + validUrisCount_ = 0; + onChanged(); + return this; + } + + private int successCount_; + /** + * + * + *
+     * Total number of URIs that have been crawled so far.
+     * 
+ * + * int32 success_count = 5; + * + * @return The successCount. + */ + @java.lang.Override + public int getSuccessCount() { + return successCount_; + } + /** + * + * + *
+     * Total number of URIs that have been crawled so far.
+     * 
+ * + * int32 success_count = 5; + * + * @param value The successCount to set. + * @return This builder for chaining. + */ + public Builder setSuccessCount(int value) { + + successCount_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Total number of URIs that have been crawled so far.
+     * 
+ * + * int32 success_count = 5; + * + * @return This builder for chaining. + */ + public Builder clearSuccessCount() { + bitField0_ = (bitField0_ & ~0x00000010); + successCount_ = 0; + onChanged(); + return this; + } + + private int pendingCount_; + /** + * + * + *
+     * Total number of URIs that have yet to be crawled.
+     * 
+ * + * int32 pending_count = 6; + * + * @return The pendingCount. + */ + @java.lang.Override + public int getPendingCount() { + return pendingCount_; + } + /** + * + * + *
+     * Total number of URIs that have yet to be crawled.
+     * 
+ * + * int32 pending_count = 6; + * + * @param value The pendingCount to set. + * @return This builder for chaining. + */ + public Builder setPendingCount(int value) { + + pendingCount_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Total number of URIs that have yet to be crawled.
+     * 
+ * + * int32 pending_count = 6; + * + * @return This builder for chaining. + */ + public Builder clearPendingCount() { + bitField0_ = (bitField0_ & ~0x00000020); + pendingCount_ = 0; + onChanged(); + return this; + } + + private int quotaExceededCount_; + /** + * + * + *
+     * Total number of URIs that were rejected due to insufficient indexing
+     * resources.
+     * 
+ * + * int32 quota_exceeded_count = 7; + * + * @return The quotaExceededCount. + */ + @java.lang.Override + public int getQuotaExceededCount() { + return quotaExceededCount_; + } + /** + * + * + *
+     * Total number of URIs that were rejected due to insufficient indexing
+     * resources.
+     * 
+ * + * int32 quota_exceeded_count = 7; + * + * @param value The quotaExceededCount to set. + * @return This builder for chaining. + */ + public Builder setQuotaExceededCount(int value) { + + quotaExceededCount_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Total number of URIs that were rejected due to insufficient indexing
+     * resources.
+     * 
+ * + * int32 quota_exceeded_count = 7; + * + * @return This builder for chaining. + */ + public Builder clearQuotaExceededCount() { + bitField0_ = (bitField0_ & ~0x00000040); + quotaExceededCount_ = 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.discoveryengine.v1alpha.RecrawlUrisMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata) + private static final com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata(); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RecrawlUrisMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisMetadataOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisMetadataOrBuilder.java new file mode 100644 index 000000000000..e968869994e1 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisMetadataOrBuilder.java @@ -0,0 +1,210 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/site_search_engine_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface RecrawlUrisMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata) + 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(); + + /** + * + * + *
+   * Unique URIs in the request that don't match any TargetSite in the
+   * DataStore, only match TargetSites that haven't been fully indexed, or match
+   * a TargetSite with type EXCLUDE.
+   * 
+ * + * repeated string invalid_uris = 3; + * + * @return A list containing the invalidUris. + */ + java.util.List getInvalidUrisList(); + /** + * + * + *
+   * Unique URIs in the request that don't match any TargetSite in the
+   * DataStore, only match TargetSites that haven't been fully indexed, or match
+   * a TargetSite with type EXCLUDE.
+   * 
+ * + * repeated string invalid_uris = 3; + * + * @return The count of invalidUris. + */ + int getInvalidUrisCount(); + /** + * + * + *
+   * Unique URIs in the request that don't match any TargetSite in the
+   * DataStore, only match TargetSites that haven't been fully indexed, or match
+   * a TargetSite with type EXCLUDE.
+   * 
+ * + * repeated string invalid_uris = 3; + * + * @param index The index of the element to return. + * @return The invalidUris at the given index. + */ + java.lang.String getInvalidUris(int index); + /** + * + * + *
+   * Unique URIs in the request that don't match any TargetSite in the
+   * DataStore, only match TargetSites that haven't been fully indexed, or match
+   * a TargetSite with type EXCLUDE.
+   * 
+ * + * repeated string invalid_uris = 3; + * + * @param index The index of the value to return. + * @return The bytes of the invalidUris at the given index. + */ + com.google.protobuf.ByteString getInvalidUrisBytes(int index); + + /** + * + * + *
+   * Total number of unique URIs in the request that are not in invalid_uris.
+   * 
+ * + * int32 valid_uris_count = 4; + * + * @return The validUrisCount. + */ + int getValidUrisCount(); + + /** + * + * + *
+   * Total number of URIs that have been crawled so far.
+   * 
+ * + * int32 success_count = 5; + * + * @return The successCount. + */ + int getSuccessCount(); + + /** + * + * + *
+   * Total number of URIs that have yet to be crawled.
+   * 
+ * + * int32 pending_count = 6; + * + * @return The pendingCount. + */ + int getPendingCount(); + + /** + * + * + *
+   * Total number of URIs that were rejected due to insufficient indexing
+   * resources.
+   * 
+ * + * int32 quota_exceeded_count = 7; + * + * @return The quotaExceededCount. + */ + int getQuotaExceededCount(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisRequest.java new file mode 100644 index 000000000000..94970d18b7e2 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisRequest.java @@ -0,0 +1,980 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/site_search_engine_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request message for
+ * [SiteSearchEngineService.RecrawlUris][google.cloud.discoveryengine.v1alpha.SiteSearchEngineService.RecrawlUris]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest} + */ +public final class RecrawlUrisRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest) + RecrawlUrisRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RecrawlUrisRequest.newBuilder() to construct. + private RecrawlUrisRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RecrawlUrisRequest() { + siteSearchEngine_ = ""; + uris_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RecrawlUrisRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest.class, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest.Builder.class); + } + + public static final int SITE_SEARCH_ENGINE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object siteSearchEngine_ = ""; + /** + * + * + *
+   * Required. Full resource name of the
+   * [SiteSearchEngine][google.cloud.discoveryengine.v1alpha.SiteSearchEngine],
+   * such as
+   * `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`.
+   * 
+ * + * + * string site_search_engine = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The siteSearchEngine. + */ + @java.lang.Override + public java.lang.String getSiteSearchEngine() { + java.lang.Object ref = siteSearchEngine_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + siteSearchEngine_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Full resource name of the
+   * [SiteSearchEngine][google.cloud.discoveryengine.v1alpha.SiteSearchEngine],
+   * such as
+   * `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`.
+   * 
+ * + * + * string site_search_engine = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for siteSearchEngine. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSiteSearchEngineBytes() { + java.lang.Object ref = siteSearchEngine_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + siteSearchEngine_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int URIS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList uris_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Required. List of URIs to crawl. At most 10K URIs are supported, otherwise
+   * an INVALID_ARGUMENT error is thrown. Each URI should match at least one
+   * [TargetSite][google.cloud.discoveryengine.v1alpha.TargetSite] in
+   * `site_search_engine`.
+   * 
+ * + * repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the uris. + */ + public com.google.protobuf.ProtocolStringList getUrisList() { + return uris_; + } + /** + * + * + *
+   * Required. List of URIs to crawl. At most 10K URIs are supported, otherwise
+   * an INVALID_ARGUMENT error is thrown. Each URI should match at least one
+   * [TargetSite][google.cloud.discoveryengine.v1alpha.TargetSite] in
+   * `site_search_engine`.
+   * 
+ * + * repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of uris. + */ + public int getUrisCount() { + return uris_.size(); + } + /** + * + * + *
+   * Required. List of URIs to crawl. At most 10K URIs are supported, otherwise
+   * an INVALID_ARGUMENT error is thrown. Each URI should match at least one
+   * [TargetSite][google.cloud.discoveryengine.v1alpha.TargetSite] in
+   * `site_search_engine`.
+   * 
+ * + * repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The uris at the given index. + */ + public java.lang.String getUris(int index) { + return uris_.get(index); + } + /** + * + * + *
+   * Required. List of URIs to crawl. At most 10K URIs are supported, otherwise
+   * an INVALID_ARGUMENT error is thrown. Each URI should match at least one
+   * [TargetSite][google.cloud.discoveryengine.v1alpha.TargetSite] in
+   * `site_search_engine`.
+   * 
+ * + * repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the uris at the given index. + */ + public com.google.protobuf.ByteString getUrisBytes(int index) { + return uris_.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(siteSearchEngine_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, siteSearchEngine_); + } + for (int i = 0; i < uris_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, uris_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(siteSearchEngine_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, siteSearchEngine_); + } + { + int dataSize = 0; + for (int i = 0; i < uris_.size(); i++) { + dataSize += computeStringSizeNoTag(uris_.getRaw(i)); + } + size += dataSize; + size += 1 * getUrisList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest other = + (com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest) obj; + + if (!getSiteSearchEngine().equals(other.getSiteSearchEngine())) return false; + if (!getUrisList().equals(other.getUrisList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SITE_SEARCH_ENGINE_FIELD_NUMBER; + hash = (53 * hash) + getSiteSearchEngine().hashCode(); + if (getUrisCount() > 0) { + hash = (37 * hash) + URIS_FIELD_NUMBER; + hash = (53 * hash) + getUrisList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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
+   * [SiteSearchEngineService.RecrawlUris][google.cloud.discoveryengine.v1alpha.SiteSearchEngineService.RecrawlUris]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest) + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest.class, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + siteSearchEngine_ = ""; + uris_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest build() { + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest result = + new com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.siteSearchEngine_ = siteSearchEngine_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + uris_.makeImmutable(); + result.uris_ = uris_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest other) { + if (other == com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest.getDefaultInstance()) + return this; + if (!other.getSiteSearchEngine().isEmpty()) { + siteSearchEngine_ = other.siteSearchEngine_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.uris_.isEmpty()) { + if (uris_.isEmpty()) { + uris_ = other.uris_; + bitField0_ |= 0x00000002; + } else { + ensureUrisIsMutable(); + uris_.addAll(other.uris_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + siteSearchEngine_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUrisIsMutable(); + uris_.add(s); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object siteSearchEngine_ = ""; + /** + * + * + *
+     * Required. Full resource name of the
+     * [SiteSearchEngine][google.cloud.discoveryengine.v1alpha.SiteSearchEngine],
+     * such as
+     * `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`.
+     * 
+ * + * + * string site_search_engine = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The siteSearchEngine. + */ + public java.lang.String getSiteSearchEngine() { + java.lang.Object ref = siteSearchEngine_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + siteSearchEngine_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of the
+     * [SiteSearchEngine][google.cloud.discoveryengine.v1alpha.SiteSearchEngine],
+     * such as
+     * `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`.
+     * 
+ * + * + * string site_search_engine = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for siteSearchEngine. + */ + public com.google.protobuf.ByteString getSiteSearchEngineBytes() { + java.lang.Object ref = siteSearchEngine_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + siteSearchEngine_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of the
+     * [SiteSearchEngine][google.cloud.discoveryengine.v1alpha.SiteSearchEngine],
+     * such as
+     * `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`.
+     * 
+ * + * + * string site_search_engine = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The siteSearchEngine to set. + * @return This builder for chaining. + */ + public Builder setSiteSearchEngine(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + siteSearchEngine_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of the
+     * [SiteSearchEngine][google.cloud.discoveryengine.v1alpha.SiteSearchEngine],
+     * such as
+     * `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`.
+     * 
+ * + * + * string site_search_engine = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearSiteSearchEngine() { + siteSearchEngine_ = getDefaultInstance().getSiteSearchEngine(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of the
+     * [SiteSearchEngine][google.cloud.discoveryengine.v1alpha.SiteSearchEngine],
+     * such as
+     * `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`.
+     * 
+ * + * + * string site_search_engine = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for siteSearchEngine to set. + * @return This builder for chaining. + */ + public Builder setSiteSearchEngineBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + siteSearchEngine_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList uris_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureUrisIsMutable() { + if (!uris_.isModifiable()) { + uris_ = new com.google.protobuf.LazyStringArrayList(uris_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+     * Required. List of URIs to crawl. At most 10K URIs are supported, otherwise
+     * an INVALID_ARGUMENT error is thrown. Each URI should match at least one
+     * [TargetSite][google.cloud.discoveryengine.v1alpha.TargetSite] in
+     * `site_search_engine`.
+     * 
+ * + * repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the uris. + */ + public com.google.protobuf.ProtocolStringList getUrisList() { + uris_.makeImmutable(); + return uris_; + } + /** + * + * + *
+     * Required. List of URIs to crawl. At most 10K URIs are supported, otherwise
+     * an INVALID_ARGUMENT error is thrown. Each URI should match at least one
+     * [TargetSite][google.cloud.discoveryengine.v1alpha.TargetSite] in
+     * `site_search_engine`.
+     * 
+ * + * repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of uris. + */ + public int getUrisCount() { + return uris_.size(); + } + /** + * + * + *
+     * Required. List of URIs to crawl. At most 10K URIs are supported, otherwise
+     * an INVALID_ARGUMENT error is thrown. Each URI should match at least one
+     * [TargetSite][google.cloud.discoveryengine.v1alpha.TargetSite] in
+     * `site_search_engine`.
+     * 
+ * + * repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The uris at the given index. + */ + public java.lang.String getUris(int index) { + return uris_.get(index); + } + /** + * + * + *
+     * Required. List of URIs to crawl. At most 10K URIs are supported, otherwise
+     * an INVALID_ARGUMENT error is thrown. Each URI should match at least one
+     * [TargetSite][google.cloud.discoveryengine.v1alpha.TargetSite] in
+     * `site_search_engine`.
+     * 
+ * + * repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the uris at the given index. + */ + public com.google.protobuf.ByteString getUrisBytes(int index) { + return uris_.getByteString(index); + } + /** + * + * + *
+     * Required. List of URIs to crawl. At most 10K URIs are supported, otherwise
+     * an INVALID_ARGUMENT error is thrown. Each URI should match at least one
+     * [TargetSite][google.cloud.discoveryengine.v1alpha.TargetSite] in
+     * `site_search_engine`.
+     * 
+ * + * repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The uris to set. + * @return This builder for chaining. + */ + public Builder setUris(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUrisIsMutable(); + uris_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. List of URIs to crawl. At most 10K URIs are supported, otherwise
+     * an INVALID_ARGUMENT error is thrown. Each URI should match at least one
+     * [TargetSite][google.cloud.discoveryengine.v1alpha.TargetSite] in
+     * `site_search_engine`.
+     * 
+ * + * repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The uris to add. + * @return This builder for chaining. + */ + public Builder addUris(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUrisIsMutable(); + uris_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. List of URIs to crawl. At most 10K URIs are supported, otherwise
+     * an INVALID_ARGUMENT error is thrown. Each URI should match at least one
+     * [TargetSite][google.cloud.discoveryengine.v1alpha.TargetSite] in
+     * `site_search_engine`.
+     * 
+ * + * repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The uris to add. + * @return This builder for chaining. + */ + public Builder addAllUris(java.lang.Iterable values) { + ensureUrisIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, uris_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. List of URIs to crawl. At most 10K URIs are supported, otherwise
+     * an INVALID_ARGUMENT error is thrown. Each URI should match at least one
+     * [TargetSite][google.cloud.discoveryengine.v1alpha.TargetSite] in
+     * `site_search_engine`.
+     * 
+ * + * repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearUris() { + uris_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. List of URIs to crawl. At most 10K URIs are supported, otherwise
+     * an INVALID_ARGUMENT error is thrown. Each URI should match at least one
+     * [TargetSite][google.cloud.discoveryengine.v1alpha.TargetSite] in
+     * `site_search_engine`.
+     * 
+ * + * repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the uris to add. + * @return This builder for chaining. + */ + public Builder addUrisBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUrisIsMutable(); + uris_.add(value); + bitField0_ |= 0x00000002; + 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.discoveryengine.v1alpha.RecrawlUrisRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest) + private static final com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RecrawlUrisRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisRequestOrBuilder.java new file mode 100644 index 000000000000..66602cfa015b --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisRequestOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/site_search_engine_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface RecrawlUrisRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of the
+   * [SiteSearchEngine][google.cloud.discoveryengine.v1alpha.SiteSearchEngine],
+   * such as
+   * `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`.
+   * 
+ * + * + * string site_search_engine = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The siteSearchEngine. + */ + java.lang.String getSiteSearchEngine(); + /** + * + * + *
+   * Required. Full resource name of the
+   * [SiteSearchEngine][google.cloud.discoveryengine.v1alpha.SiteSearchEngine],
+   * such as
+   * `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`.
+   * 
+ * + * + * string site_search_engine = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for siteSearchEngine. + */ + com.google.protobuf.ByteString getSiteSearchEngineBytes(); + + /** + * + * + *
+   * Required. List of URIs to crawl. At most 10K URIs are supported, otherwise
+   * an INVALID_ARGUMENT error is thrown. Each URI should match at least one
+   * [TargetSite][google.cloud.discoveryengine.v1alpha.TargetSite] in
+   * `site_search_engine`.
+   * 
+ * + * repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the uris. + */ + java.util.List getUrisList(); + /** + * + * + *
+   * Required. List of URIs to crawl. At most 10K URIs are supported, otherwise
+   * an INVALID_ARGUMENT error is thrown. Each URI should match at least one
+   * [TargetSite][google.cloud.discoveryengine.v1alpha.TargetSite] in
+   * `site_search_engine`.
+   * 
+ * + * repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of uris. + */ + int getUrisCount(); + /** + * + * + *
+   * Required. List of URIs to crawl. At most 10K URIs are supported, otherwise
+   * an INVALID_ARGUMENT error is thrown. Each URI should match at least one
+   * [TargetSite][google.cloud.discoveryengine.v1alpha.TargetSite] in
+   * `site_search_engine`.
+   * 
+ * + * repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The uris at the given index. + */ + java.lang.String getUris(int index); + /** + * + * + *
+   * Required. List of URIs to crawl. At most 10K URIs are supported, otherwise
+   * an INVALID_ARGUMENT error is thrown. Each URI should match at least one
+   * [TargetSite][google.cloud.discoveryengine.v1alpha.TargetSite] in
+   * `site_search_engine`.
+   * 
+ * + * repeated string uris = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the uris at the given index. + */ + com.google.protobuf.ByteString getUrisBytes(int index); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisResponse.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisResponse.java new file mode 100644 index 000000000000..f9812b906f5d --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisResponse.java @@ -0,0 +1,3742 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/site_search_engine_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Response message for
+ * [SiteSearchEngineService.RecrawlUris][google.cloud.discoveryengine.v1alpha.SiteSearchEngineService.RecrawlUris]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse} + */ +public final class RecrawlUrisResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse) + RecrawlUrisResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use RecrawlUrisResponse.newBuilder() to construct. + private RecrawlUrisResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RecrawlUrisResponse() { + failureSamples_ = java.util.Collections.emptyList(); + failedUris_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RecrawlUrisResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.class, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.Builder.class); + } + + public interface FailureInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * URI that failed to be crawled.
+     * 
+ * + * string uri = 1; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+     * URI that failed to be crawled.
+     * 
+ * + * string uri = 1; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+     * List of failure reasons by corpus type (e.g. desktop, mobile).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + java.util.List< + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason> + getFailureReasonsList(); + /** + * + * + *
+     * List of failure reasons by corpus type (e.g. desktop, mobile).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + getFailureReasons(int index); + /** + * + * + *
+     * List of failure reasons by corpus type (e.g. desktop, mobile).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + int getFailureReasonsCount(); + /** + * + * + *
+     * List of failure reasons by corpus type (e.g. desktop, mobile).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReasonOrBuilder> + getFailureReasonsOrBuilderList(); + /** + * + * + *
+     * List of failure reasons by corpus type (e.g. desktop, mobile).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReasonOrBuilder + getFailureReasonsOrBuilder(int index); + } + /** + * + * + *
+   * Details about why a particular URI failed to be crawled. Each FailureInfo
+   * contains one FailureReason per CorpusType.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo} + */ + public static final class FailureInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo) + FailureInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use FailureInfo.newBuilder() to construct. + private FailureInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FailureInfo() { + uri_ = ""; + failureReasons_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FailureInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_FailureInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_FailureInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.class, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.Builder + .class); + } + + public interface FailureReasonOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * DESKTOP, MOBILE, or CORPUS_TYPE_UNSPECIFIED.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason.CorpusType corpus_type = 1; + * + * + * @return The enum numeric value on the wire for corpusType. + */ + int getCorpusTypeValue(); + /** + * + * + *
+       * DESKTOP, MOBILE, or CORPUS_TYPE_UNSPECIFIED.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason.CorpusType corpus_type = 1; + * + * + * @return The corpusType. + */ + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + .CorpusType + getCorpusType(); + + /** + * + * + *
+       * Reason why the URI was not crawled.
+       * 
+ * + * string error_message = 2; + * + * @return The errorMessage. + */ + java.lang.String getErrorMessage(); + /** + * + * + *
+       * Reason why the URI was not crawled.
+       * 
+ * + * string error_message = 2; + * + * @return The bytes for errorMessage. + */ + com.google.protobuf.ByteString getErrorMessageBytes(); + } + /** + * + * + *
+     * Details about why crawling failed for a particular CorpusType, e.g.
+     * DESKTOP and MOBILE crawling may fail for different reasons.
+     * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason} + */ + public static final class FailureReason extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason) + FailureReasonOrBuilder { + private static final long serialVersionUID = 0L; + // Use FailureReason.newBuilder() to construct. + private FailureReason(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FailureReason() { + corpusType_ = 0; + errorMessage_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FailureReason(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_FailureInfo_FailureReason_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_FailureInfo_FailureReason_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason.class, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason.Builder.class); + } + + /** + * + * + *
+       * CorpusType for the failed crawling operation.
+       * 
+ * + * Protobuf enum {@code + * google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason.CorpusType} + */ + public enum CorpusType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+         * Default value.
+         * 
+ * + * CORPUS_TYPE_UNSPECIFIED = 0; + */ + CORPUS_TYPE_UNSPECIFIED(0), + /** + * + * + *
+         * Denotes a crawling attempt for the desktop version of a page.
+         * 
+ * + * DESKTOP = 1; + */ + DESKTOP(1), + /** + * + * + *
+         * Denotes a crawling attempt for the mobile version of a page.
+         * 
+ * + * MOBILE = 2; + */ + MOBILE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+         * Default value.
+         * 
+ * + * CORPUS_TYPE_UNSPECIFIED = 0; + */ + public static final int CORPUS_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+         * Denotes a crawling attempt for the desktop version of a page.
+         * 
+ * + * DESKTOP = 1; + */ + public static final int DESKTOP_VALUE = 1; + /** + * + * + *
+         * Denotes a crawling attempt for the mobile version of a page.
+         * 
+ * + * MOBILE = 2; + */ + public static final int MOBILE_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 CorpusType 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 CorpusType forNumber(int value) { + switch (value) { + case 0: + return CORPUS_TYPE_UNSPECIFIED; + case 1: + return DESKTOP; + case 2: + return MOBILE; + 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 CorpusType findValueByNumber(int number) { + return CorpusType.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.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final CorpusType[] VALUES = values(); + + public static CorpusType 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 CorpusType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason.CorpusType) + } + + public static final int CORPUS_TYPE_FIELD_NUMBER = 1; + private int corpusType_ = 0; + /** + * + * + *
+       * DESKTOP, MOBILE, or CORPUS_TYPE_UNSPECIFIED.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason.CorpusType corpus_type = 1; + * + * + * @return The enum numeric value on the wire for corpusType. + */ + @java.lang.Override + public int getCorpusTypeValue() { + return corpusType_; + } + /** + * + * + *
+       * DESKTOP, MOBILE, or CORPUS_TYPE_UNSPECIFIED.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason.CorpusType corpus_type = 1; + * + * + * @return The corpusType. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + .CorpusType + getCorpusType() { + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + .CorpusType + result = + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason.CorpusType.forNumber(corpusType_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + .CorpusType.UNRECOGNIZED + : result; + } + + public static final int ERROR_MESSAGE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object errorMessage_ = ""; + /** + * + * + *
+       * Reason why the URI was not crawled.
+       * 
+ * + * string error_message = 2; + * + * @return The errorMessage. + */ + @java.lang.Override + public java.lang.String getErrorMessage() { + java.lang.Object ref = errorMessage_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errorMessage_ = s; + return s; + } + } + /** + * + * + *
+       * Reason why the URI was not crawled.
+       * 
+ * + * string error_message = 2; + * + * @return The bytes for errorMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getErrorMessageBytes() { + java.lang.Object ref = errorMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMessage_ = 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 (corpusType_ + != com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason.CorpusType.CORPUS_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, corpusType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, errorMessage_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (corpusType_ + != com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason.CorpusType.CORPUS_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, corpusType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, errorMessage_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + other = + (com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason) + obj; + + if (corpusType_ != other.corpusType_) return false; + if (!getErrorMessage().equals(other.getErrorMessage())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CORPUS_TYPE_FIELD_NUMBER; + hash = (53 * hash) + corpusType_; + hash = (37 * hash) + ERROR_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getErrorMessage().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * Details about why crawling failed for a particular CorpusType, e.g.
+       * DESKTOP and MOBILE crawling may fail for different reasons.
+       * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason) + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReasonOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_FailureInfo_FailureReason_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_FailureInfo_FailureReason_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason.class, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + corpusType_ = 0; + errorMessage_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_FailureInfo_FailureReason_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason + build() { + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason + buildPartial() { + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + result = + new com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.corpusType_ = corpusType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.errorMessage_ = errorMessage_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason.getDefaultInstance()) return this; + if (other.corpusType_ != 0) { + setCorpusTypeValue(other.getCorpusTypeValue()); + } + if (!other.getErrorMessage().isEmpty()) { + errorMessage_ = other.errorMessage_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + corpusType_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + errorMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int corpusType_ = 0; + /** + * + * + *
+         * DESKTOP, MOBILE, or CORPUS_TYPE_UNSPECIFIED.
+         * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason.CorpusType corpus_type = 1; + * + * + * @return The enum numeric value on the wire for corpusType. + */ + @java.lang.Override + public int getCorpusTypeValue() { + return corpusType_; + } + /** + * + * + *
+         * DESKTOP, MOBILE, or CORPUS_TYPE_UNSPECIFIED.
+         * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason.CorpusType corpus_type = 1; + * + * + * @param value The enum numeric value on the wire for corpusType to set. + * @return This builder for chaining. + */ + public Builder setCorpusTypeValue(int value) { + corpusType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * DESKTOP, MOBILE, or CORPUS_TYPE_UNSPECIFIED.
+         * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason.CorpusType corpus_type = 1; + * + * + * @return The corpusType. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason.CorpusType + getCorpusType() { + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + .CorpusType + result = + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason.CorpusType.forNumber(corpusType_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason.CorpusType.UNRECOGNIZED + : result; + } + /** + * + * + *
+         * DESKTOP, MOBILE, or CORPUS_TYPE_UNSPECIFIED.
+         * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason.CorpusType corpus_type = 1; + * + * + * @param value The corpusType to set. + * @return This builder for chaining. + */ + public Builder setCorpusType( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + .CorpusType + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + corpusType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+         * DESKTOP, MOBILE, or CORPUS_TYPE_UNSPECIFIED.
+         * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason.CorpusType corpus_type = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearCorpusType() { + bitField0_ = (bitField0_ & ~0x00000001); + corpusType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object errorMessage_ = ""; + /** + * + * + *
+         * Reason why the URI was not crawled.
+         * 
+ * + * string error_message = 2; + * + * @return The errorMessage. + */ + public java.lang.String getErrorMessage() { + java.lang.Object ref = errorMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errorMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Reason why the URI was not crawled.
+         * 
+ * + * string error_message = 2; + * + * @return The bytes for errorMessage. + */ + public com.google.protobuf.ByteString getErrorMessageBytes() { + java.lang.Object ref = errorMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Reason why the URI was not crawled.
+         * 
+ * + * string error_message = 2; + * + * @param value The errorMessage to set. + * @return This builder for chaining. + */ + public Builder setErrorMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + errorMessage_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * Reason why the URI was not crawled.
+         * 
+ * + * string error_message = 2; + * + * @return This builder for chaining. + */ + public Builder clearErrorMessage() { + errorMessage_ = getDefaultInstance().getErrorMessage(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+         * Reason why the URI was not crawled.
+         * 
+ * + * string error_message = 2; + * + * @param value The bytes for errorMessage to set. + * @return This builder for chaining. + */ + public Builder setErrorMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + errorMessage_ = value; + bitField0_ |= 0x00000002; + 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.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason) + private static final com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason(); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FailureReason parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int URI_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object uri_ = ""; + /** + * + * + *
+     * URI that failed to be crawled.
+     * 
+ * + * string uri = 1; + * + * @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; + } + } + /** + * + * + *
+     * URI that failed to be crawled.
+     * 
+ * + * string uri = 1; + * + * @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 FAILURE_REASONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List< + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason> + failureReasons_; + /** + * + * + *
+     * List of failure reasons by corpus type (e.g. desktop, mobile).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + @java.lang.Override + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason> + getFailureReasonsList() { + return failureReasons_; + } + /** + * + * + *
+     * List of failure reasons by corpus type (e.g. desktop, mobile).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReasonOrBuilder> + getFailureReasonsOrBuilderList() { + return failureReasons_; + } + /** + * + * + *
+     * List of failure reasons by corpus type (e.g. desktop, mobile).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + @java.lang.Override + public int getFailureReasonsCount() { + return failureReasons_.size(); + } + /** + * + * + *
+     * List of failure reasons by corpus type (e.g. desktop, mobile).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + getFailureReasons(int index) { + return failureReasons_.get(index); + } + /** + * + * + *
+     * List of failure reasons by corpus type (e.g. desktop, mobile).
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReasonOrBuilder + getFailureReasonsOrBuilder(int index) { + return failureReasons_.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(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_); + } + for (int i = 0; i < failureReasons_.size(); i++) { + output.writeMessage(2, failureReasons_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uri_); + } + for (int i = 0; i < failureReasons_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, failureReasons_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo other = + (com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo) obj; + + if (!getUri().equals(other.getUri())) return false; + if (!getFailureReasonsList().equals(other.getFailureReasonsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + if (getFailureReasonsCount() > 0) { + hash = (37 * hash) + FAILURE_REASONS_FIELD_NUMBER; + hash = (53 * hash) + getFailureReasonsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Details about why a particular URI failed to be crawled. Each FailureInfo
+     * contains one FailureReason per CorpusType.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo) + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_FailureInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_FailureInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.class, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.Builder + .class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + uri_ = ""; + if (failureReasonsBuilder_ == null) { + failureReasons_ = java.util.Collections.emptyList(); + } else { + failureReasons_ = null; + failureReasonsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_FailureInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo build() { + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + buildPartial() { + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo result = + new com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo result) { + if (failureReasonsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + failureReasons_ = java.util.Collections.unmodifiableList(failureReasons_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.failureReasons_ = failureReasons_; + } else { + result.failureReasons_ = failureReasonsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.uri_ = uri_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .getDefaultInstance()) return this; + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (failureReasonsBuilder_ == null) { + if (!other.failureReasons_.isEmpty()) { + if (failureReasons_.isEmpty()) { + failureReasons_ = other.failureReasons_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureFailureReasonsIsMutable(); + failureReasons_.addAll(other.failureReasons_); + } + onChanged(); + } + } else { + if (!other.failureReasons_.isEmpty()) { + if (failureReasonsBuilder_.isEmpty()) { + failureReasonsBuilder_.dispose(); + failureReasonsBuilder_ = null; + failureReasons_ = other.failureReasons_; + bitField0_ = (bitField0_ & ~0x00000002); + failureReasonsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFailureReasonsFieldBuilder() + : null; + } else { + failureReasonsBuilder_.addAllMessages(other.failureReasons_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + uri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason + m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse + .FailureInfo.FailureReason.parser(), + extensionRegistry); + if (failureReasonsBuilder_ == null) { + ensureFailureReasonsIsMutable(); + failureReasons_.add(m); + } else { + failureReasonsBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object uri_ = ""; + /** + * + * + *
+       * URI that failed to be crawled.
+       * 
+ * + * string uri = 1; + * + * @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; + } + } + /** + * + * + *
+       * URI that failed to be crawled.
+       * 
+ * + * string uri = 1; + * + * @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; + } + } + /** + * + * + *
+       * URI that failed to be crawled.
+       * 
+ * + * string uri = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * URI that failed to be crawled.
+       * 
+ * + * string uri = 1; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + uri_ = getDefaultInstance().getUri(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * URI that failed to be crawled.
+       * 
+ * + * string uri = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List< + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason> + failureReasons_ = java.util.Collections.emptyList(); + + private void ensureFailureReasonsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + failureReasons_ = + new java.util.ArrayList< + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason>(failureReasons_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + .Builder, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReasonOrBuilder> + failureReasonsBuilder_; + + /** + * + * + *
+       * List of failure reasons by corpus type (e.g. desktop, mobile).
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason> + getFailureReasonsList() { + if (failureReasonsBuilder_ == null) { + return java.util.Collections.unmodifiableList(failureReasons_); + } else { + return failureReasonsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * List of failure reasons by corpus type (e.g. desktop, mobile).
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + public int getFailureReasonsCount() { + if (failureReasonsBuilder_ == null) { + return failureReasons_.size(); + } else { + return failureReasonsBuilder_.getCount(); + } + } + /** + * + * + *
+       * List of failure reasons by corpus type (e.g. desktop, mobile).
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + getFailureReasons(int index) { + if (failureReasonsBuilder_ == null) { + return failureReasons_.get(index); + } else { + return failureReasonsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * List of failure reasons by corpus type (e.g. desktop, mobile).
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + public Builder setFailureReasons( + int index, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + value) { + if (failureReasonsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFailureReasonsIsMutable(); + failureReasons_.set(index, value); + onChanged(); + } else { + failureReasonsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * List of failure reasons by corpus type (e.g. desktop, mobile).
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + public Builder setFailureReasons( + int index, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + .Builder + builderForValue) { + if (failureReasonsBuilder_ == null) { + ensureFailureReasonsIsMutable(); + failureReasons_.set(index, builderForValue.build()); + onChanged(); + } else { + failureReasonsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * List of failure reasons by corpus type (e.g. desktop, mobile).
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + public Builder addFailureReasons( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + value) { + if (failureReasonsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFailureReasonsIsMutable(); + failureReasons_.add(value); + onChanged(); + } else { + failureReasonsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * List of failure reasons by corpus type (e.g. desktop, mobile).
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + public Builder addFailureReasons( + int index, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + value) { + if (failureReasonsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFailureReasonsIsMutable(); + failureReasons_.add(index, value); + onChanged(); + } else { + failureReasonsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * List of failure reasons by corpus type (e.g. desktop, mobile).
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + public Builder addFailureReasons( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + .Builder + builderForValue) { + if (failureReasonsBuilder_ == null) { + ensureFailureReasonsIsMutable(); + failureReasons_.add(builderForValue.build()); + onChanged(); + } else { + failureReasonsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * List of failure reasons by corpus type (e.g. desktop, mobile).
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + public Builder addFailureReasons( + int index, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + .Builder + builderForValue) { + if (failureReasonsBuilder_ == null) { + ensureFailureReasonsIsMutable(); + failureReasons_.add(index, builderForValue.build()); + onChanged(); + } else { + failureReasonsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * List of failure reasons by corpus type (e.g. desktop, mobile).
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + public Builder addAllFailureReasons( + java.lang.Iterable< + ? extends + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason> + values) { + if (failureReasonsBuilder_ == null) { + ensureFailureReasonsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, failureReasons_); + onChanged(); + } else { + failureReasonsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * List of failure reasons by corpus type (e.g. desktop, mobile).
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + public Builder clearFailureReasons() { + if (failureReasonsBuilder_ == null) { + failureReasons_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + failureReasonsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * List of failure reasons by corpus type (e.g. desktop, mobile).
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + public Builder removeFailureReasons(int index) { + if (failureReasonsBuilder_ == null) { + ensureFailureReasonsIsMutable(); + failureReasons_.remove(index); + onChanged(); + } else { + failureReasonsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * List of failure reasons by corpus type (e.g. desktop, mobile).
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + .Builder + getFailureReasonsBuilder(int index) { + return getFailureReasonsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * List of failure reasons by corpus type (e.g. desktop, mobile).
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReasonOrBuilder + getFailureReasonsOrBuilder(int index) { + if (failureReasonsBuilder_ == null) { + return failureReasons_.get(index); + } else { + return failureReasonsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * List of failure reasons by corpus type (e.g. desktop, mobile).
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReasonOrBuilder> + getFailureReasonsOrBuilderList() { + if (failureReasonsBuilder_ != null) { + return failureReasonsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(failureReasons_); + } + } + /** + * + * + *
+       * List of failure reasons by corpus type (e.g. desktop, mobile).
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + .Builder + addFailureReasonsBuilder() { + return getFailureReasonsFieldBuilder() + .addBuilder( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason.getDefaultInstance()); + } + /** + * + * + *
+       * List of failure reasons by corpus type (e.g. desktop, mobile).
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + .Builder + addFailureReasonsBuilder(int index) { + return getFailureReasonsFieldBuilder() + .addBuilder( + index, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason.getDefaultInstance()); + } + /** + * + * + *
+       * List of failure reasons by corpus type (e.g. desktop, mobile).
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason failure_reasons = 2; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + .Builder> + getFailureReasonsBuilderList() { + return getFailureReasonsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.FailureReason + .Builder, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReasonOrBuilder> + getFailureReasonsFieldBuilder() { + if (failureReasonsBuilder_ == null) { + failureReasonsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReason.Builder, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .FailureReasonOrBuilder>( + failureReasons_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + failureReasons_ = null; + } + return failureReasonsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo) + private static final com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo(); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FailureInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int FAILURE_SAMPLES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + failureSamples_; + /** + * + * + *
+   * Details for a sample of up to 10 `failed_uris`.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + @java.lang.Override + public java.util.List + getFailureSamplesList() { + return failureSamples_; + } + /** + * + * + *
+   * Details for a sample of up to 10 `failed_uris`.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfoOrBuilder> + getFailureSamplesOrBuilderList() { + return failureSamples_; + } + /** + * + * + *
+   * Details for a sample of up to 10 `failed_uris`.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + @java.lang.Override + public int getFailureSamplesCount() { + return failureSamples_.size(); + } + /** + * + * + *
+   * Details for a sample of up to 10 `failed_uris`.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo getFailureSamples( + int index) { + return failureSamples_.get(index); + } + /** + * + * + *
+   * Details for a sample of up to 10 `failed_uris`.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfoOrBuilder + getFailureSamplesOrBuilder(int index) { + return failureSamples_.get(index); + } + + public static final int FAILED_URIS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList failedUris_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * URIs that were not crawled before the LRO terminated.
+   * 
+ * + * repeated string failed_uris = 2; + * + * @return A list containing the failedUris. + */ + public com.google.protobuf.ProtocolStringList getFailedUrisList() { + return failedUris_; + } + /** + * + * + *
+   * URIs that were not crawled before the LRO terminated.
+   * 
+ * + * repeated string failed_uris = 2; + * + * @return The count of failedUris. + */ + public int getFailedUrisCount() { + return failedUris_.size(); + } + /** + * + * + *
+   * URIs that were not crawled before the LRO terminated.
+   * 
+ * + * repeated string failed_uris = 2; + * + * @param index The index of the element to return. + * @return The failedUris at the given index. + */ + public java.lang.String getFailedUris(int index) { + return failedUris_.get(index); + } + /** + * + * + *
+   * URIs that were not crawled before the LRO terminated.
+   * 
+ * + * repeated string failed_uris = 2; + * + * @param index The index of the value to return. + * @return The bytes of the failedUris at the given index. + */ + public com.google.protobuf.ByteString getFailedUrisBytes(int index) { + return failedUris_.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 < failureSamples_.size(); i++) { + output.writeMessage(1, failureSamples_.get(i)); + } + for (int i = 0; i < failedUris_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, failedUris_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < failureSamples_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, failureSamples_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < failedUris_.size(); i++) { + dataSize += computeStringSizeNoTag(failedUris_.getRaw(i)); + } + size += dataSize; + size += 1 * getFailedUrisList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse other = + (com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse) obj; + + if (!getFailureSamplesList().equals(other.getFailureSamplesList())) return false; + if (!getFailedUrisList().equals(other.getFailedUrisList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFailureSamplesCount() > 0) { + hash = (37 * hash) + FAILURE_SAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getFailureSamplesList().hashCode(); + } + if (getFailedUrisCount() > 0) { + hash = (37 * hash) + FAILED_URIS_FIELD_NUMBER; + hash = (53 * hash) + getFailedUrisList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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
+   * [SiteSearchEngineService.RecrawlUris][google.cloud.discoveryengine.v1alpha.SiteSearchEngineService.RecrawlUris]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse) + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.class, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (failureSamplesBuilder_ == null) { + failureSamples_ = java.util.Collections.emptyList(); + } else { + failureSamples_ = null; + failureSamplesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + failedUris_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse build() { + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse buildPartial() { + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse result = + new com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse result) { + if (failureSamplesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + failureSamples_ = java.util.Collections.unmodifiableList(failureSamples_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.failureSamples_ = failureSamples_; + } else { + result.failureSamples_ = failureSamplesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + failedUris_.makeImmutable(); + result.failedUris_ = failedUris_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.getDefaultInstance()) + return this; + if (failureSamplesBuilder_ == null) { + if (!other.failureSamples_.isEmpty()) { + if (failureSamples_.isEmpty()) { + failureSamples_ = other.failureSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFailureSamplesIsMutable(); + failureSamples_.addAll(other.failureSamples_); + } + onChanged(); + } + } else { + if (!other.failureSamples_.isEmpty()) { + if (failureSamplesBuilder_.isEmpty()) { + failureSamplesBuilder_.dispose(); + failureSamplesBuilder_ = null; + failureSamples_ = other.failureSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + failureSamplesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFailureSamplesFieldBuilder() + : null; + } else { + failureSamplesBuilder_.addAllMessages(other.failureSamples_); + } + } + } + if (!other.failedUris_.isEmpty()) { + if (failedUris_.isEmpty()) { + failedUris_ = other.failedUris_; + bitField0_ |= 0x00000002; + } else { + ensureFailedUrisIsMutable(); + failedUris_.addAll(other.failedUris_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .parser(), + extensionRegistry); + if (failureSamplesBuilder_ == null) { + ensureFailureSamplesIsMutable(); + failureSamples_.add(m); + } else { + failureSamplesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureFailedUrisIsMutable(); + failedUris_.add(s); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + failureSamples_ = java.util.Collections.emptyList(); + + private void ensureFailureSamplesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + failureSamples_ = + new java.util.ArrayList< + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo>( + failureSamples_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfoOrBuilder> + failureSamplesBuilder_; + + /** + * + * + *
+     * Details for a sample of up to 10 `failed_uris`.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + public java.util.List + getFailureSamplesList() { + if (failureSamplesBuilder_ == null) { + return java.util.Collections.unmodifiableList(failureSamples_); + } else { + return failureSamplesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Details for a sample of up to 10 `failed_uris`.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + public int getFailureSamplesCount() { + if (failureSamplesBuilder_ == null) { + return failureSamples_.size(); + } else { + return failureSamplesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Details for a sample of up to 10 `failed_uris`.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + getFailureSamples(int index) { + if (failureSamplesBuilder_ == null) { + return failureSamples_.get(index); + } else { + return failureSamplesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Details for a sample of up to 10 `failed_uris`.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + public Builder setFailureSamples( + int index, com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo value) { + if (failureSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFailureSamplesIsMutable(); + failureSamples_.set(index, value); + onChanged(); + } else { + failureSamplesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Details for a sample of up to 10 `failed_uris`.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + public Builder setFailureSamples( + int index, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.Builder + builderForValue) { + if (failureSamplesBuilder_ == null) { + ensureFailureSamplesIsMutable(); + failureSamples_.set(index, builderForValue.build()); + onChanged(); + } else { + failureSamplesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Details for a sample of up to 10 `failed_uris`.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + public Builder addFailureSamples( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo value) { + if (failureSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFailureSamplesIsMutable(); + failureSamples_.add(value); + onChanged(); + } else { + failureSamplesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Details for a sample of up to 10 `failed_uris`.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + public Builder addFailureSamples( + int index, com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo value) { + if (failureSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFailureSamplesIsMutable(); + failureSamples_.add(index, value); + onChanged(); + } else { + failureSamplesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Details for a sample of up to 10 `failed_uris`.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + public Builder addFailureSamples( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.Builder + builderForValue) { + if (failureSamplesBuilder_ == null) { + ensureFailureSamplesIsMutable(); + failureSamples_.add(builderForValue.build()); + onChanged(); + } else { + failureSamplesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Details for a sample of up to 10 `failed_uris`.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + public Builder addFailureSamples( + int index, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.Builder + builderForValue) { + if (failureSamplesBuilder_ == null) { + ensureFailureSamplesIsMutable(); + failureSamples_.add(index, builderForValue.build()); + onChanged(); + } else { + failureSamplesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Details for a sample of up to 10 `failed_uris`.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + public Builder addAllFailureSamples( + java.lang.Iterable< + ? extends com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo> + values) { + if (failureSamplesBuilder_ == null) { + ensureFailureSamplesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, failureSamples_); + onChanged(); + } else { + failureSamplesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Details for a sample of up to 10 `failed_uris`.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + public Builder clearFailureSamples() { + if (failureSamplesBuilder_ == null) { + failureSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + failureSamplesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Details for a sample of up to 10 `failed_uris`.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + public Builder removeFailureSamples(int index) { + if (failureSamplesBuilder_ == null) { + ensureFailureSamplesIsMutable(); + failureSamples_.remove(index); + onChanged(); + } else { + failureSamplesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Details for a sample of up to 10 `failed_uris`.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.Builder + getFailureSamplesBuilder(int index) { + return getFailureSamplesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Details for a sample of up to 10 `failed_uris`.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfoOrBuilder + getFailureSamplesOrBuilder(int index) { + if (failureSamplesBuilder_ == null) { + return failureSamples_.get(index); + } else { + return failureSamplesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Details for a sample of up to 10 `failed_uris`.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfoOrBuilder> + getFailureSamplesOrBuilderList() { + if (failureSamplesBuilder_ != null) { + return failureSamplesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(failureSamples_); + } + } + /** + * + * + *
+     * Details for a sample of up to 10 `failed_uris`.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.Builder + addFailureSamplesBuilder() { + return getFailureSamplesFieldBuilder() + .addBuilder( + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .getDefaultInstance()); + } + /** + * + * + *
+     * Details for a sample of up to 10 `failed_uris`.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.Builder + addFailureSamplesBuilder(int index) { + return getFailureSamplesFieldBuilder() + .addBuilder( + index, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo + .getDefaultInstance()); + } + /** + * + * + *
+     * Details for a sample of up to 10 `failed_uris`.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.Builder> + getFailureSamplesBuilderList() { + return getFailureSamplesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfoOrBuilder> + getFailureSamplesFieldBuilder() { + if (failureSamplesBuilder_ == null) { + failureSamplesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfoOrBuilder>( + failureSamples_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + failureSamples_ = null; + } + return failureSamplesBuilder_; + } + + private com.google.protobuf.LazyStringArrayList failedUris_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureFailedUrisIsMutable() { + if (!failedUris_.isModifiable()) { + failedUris_ = new com.google.protobuf.LazyStringArrayList(failedUris_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+     * URIs that were not crawled before the LRO terminated.
+     * 
+ * + * repeated string failed_uris = 2; + * + * @return A list containing the failedUris. + */ + public com.google.protobuf.ProtocolStringList getFailedUrisList() { + failedUris_.makeImmutable(); + return failedUris_; + } + /** + * + * + *
+     * URIs that were not crawled before the LRO terminated.
+     * 
+ * + * repeated string failed_uris = 2; + * + * @return The count of failedUris. + */ + public int getFailedUrisCount() { + return failedUris_.size(); + } + /** + * + * + *
+     * URIs that were not crawled before the LRO terminated.
+     * 
+ * + * repeated string failed_uris = 2; + * + * @param index The index of the element to return. + * @return The failedUris at the given index. + */ + public java.lang.String getFailedUris(int index) { + return failedUris_.get(index); + } + /** + * + * + *
+     * URIs that were not crawled before the LRO terminated.
+     * 
+ * + * repeated string failed_uris = 2; + * + * @param index The index of the value to return. + * @return The bytes of the failedUris at the given index. + */ + public com.google.protobuf.ByteString getFailedUrisBytes(int index) { + return failedUris_.getByteString(index); + } + /** + * + * + *
+     * URIs that were not crawled before the LRO terminated.
+     * 
+ * + * repeated string failed_uris = 2; + * + * @param index The index to set the value at. + * @param value The failedUris to set. + * @return This builder for chaining. + */ + public Builder setFailedUris(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFailedUrisIsMutable(); + failedUris_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * URIs that were not crawled before the LRO terminated.
+     * 
+ * + * repeated string failed_uris = 2; + * + * @param value The failedUris to add. + * @return This builder for chaining. + */ + public Builder addFailedUris(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFailedUrisIsMutable(); + failedUris_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * URIs that were not crawled before the LRO terminated.
+     * 
+ * + * repeated string failed_uris = 2; + * + * @param values The failedUris to add. + * @return This builder for chaining. + */ + public Builder addAllFailedUris(java.lang.Iterable values) { + ensureFailedUrisIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, failedUris_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * URIs that were not crawled before the LRO terminated.
+     * 
+ * + * repeated string failed_uris = 2; + * + * @return This builder for chaining. + */ + public Builder clearFailedUris() { + failedUris_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * URIs that were not crawled before the LRO terminated.
+     * 
+ * + * repeated string failed_uris = 2; + * + * @param value The bytes of the failedUris to add. + * @return This builder for chaining. + */ + public Builder addFailedUrisBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureFailedUrisIsMutable(); + failedUris_.add(value); + bitField0_ |= 0x00000002; + 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.discoveryengine.v1alpha.RecrawlUrisResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse) + private static final com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse(); + } + + public static com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RecrawlUrisResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisResponseOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisResponseOrBuilder.java new file mode 100644 index 000000000000..2c0a0c2dde78 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/RecrawlUrisResponseOrBuilder.java @@ -0,0 +1,143 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/site_search_engine_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface RecrawlUrisResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Details for a sample of up to 10 `failed_uris`.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + java.util.List + getFailureSamplesList(); + /** + * + * + *
+   * Details for a sample of up to 10 `failed_uris`.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo getFailureSamples( + int index); + /** + * + * + *
+   * Details for a sample of up to 10 `failed_uris`.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + int getFailureSamplesCount(); + /** + * + * + *
+   * Details for a sample of up to 10 `failed_uris`.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfoOrBuilder> + getFailureSamplesOrBuilderList(); + /** + * + * + *
+   * Details for a sample of up to 10 `failed_uris`.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfo failure_samples = 1; + * + */ + com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse.FailureInfoOrBuilder + getFailureSamplesOrBuilder(int index); + + /** + * + * + *
+   * URIs that were not crawled before the LRO terminated.
+   * 
+ * + * repeated string failed_uris = 2; + * + * @return A list containing the failedUris. + */ + java.util.List getFailedUrisList(); + /** + * + * + *
+   * URIs that were not crawled before the LRO terminated.
+   * 
+ * + * repeated string failed_uris = 2; + * + * @return The count of failedUris. + */ + int getFailedUrisCount(); + /** + * + * + *
+   * URIs that were not crawled before the LRO terminated.
+   * 
+ * + * repeated string failed_uris = 2; + * + * @param index The index of the element to return. + * @return The failedUris at the given index. + */ + java.lang.String getFailedUris(int index); + /** + * + * + *
+   * URIs that were not crawled before the LRO terminated.
+   * 
+ * + * repeated string failed_uris = 2; + * + * @param index The index of the value to return. + * @return The bytes of the failedUris at the given index. + */ + com.google.protobuf.ByteString getFailedUrisBytes(int index); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/Reply.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/Reply.java new file mode 100644 index 000000000000..1e55f9897da8 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/Reply.java @@ -0,0 +1,2565 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversation.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Defines a reply message to user.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.Reply} + */ +public final class Reply extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.Reply) + ReplyOrBuilder { + private static final long serialVersionUID = 0L; + // Use Reply.newBuilder() to construct. + private Reply(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Reply() { + reply_ = ""; + references_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Reply(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_Reply_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_Reply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.Reply.class, + com.google.cloud.discoveryengine.v1alpha.Reply.Builder.class); + } + + @java.lang.Deprecated + public interface ReferenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.Reply.Reference) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * URI link reference.
+     * 
+ * + * string uri = 1; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+     * URI link reference.
+     * 
+ * + * string uri = 1; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+     * Anchor text.
+     * 
+ * + * string anchor_text = 2; + * + * @return The anchorText. + */ + java.lang.String getAnchorText(); + /** + * + * + *
+     * Anchor text.
+     * 
+ * + * string anchor_text = 2; + * + * @return The bytes for anchorText. + */ + com.google.protobuf.ByteString getAnchorTextBytes(); + + /** + * + * + *
+     * Anchor text start index.
+     * 
+ * + * int32 start = 3; + * + * @return The start. + */ + int getStart(); + + /** + * + * + *
+     * Anchor text end index.
+     * 
+ * + * int32 end = 4; + * + * @return The end. + */ + int getEnd(); + } + /** + * + * + *
+   * Defines reference in reply.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.Reply.Reference} + */ + @java.lang.Deprecated + public static final class Reference extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.Reply.Reference) + ReferenceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Reference.newBuilder() to construct. + private Reference(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Reference() { + uri_ = ""; + anchorText_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Reference(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_Reply_Reference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_Reply_Reference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.Reply.Reference.class, + com.google.cloud.discoveryengine.v1alpha.Reply.Reference.Builder.class); + } + + public static final int URI_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object uri_ = ""; + /** + * + * + *
+     * URI link reference.
+     * 
+ * + * string uri = 1; + * + * @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; + } + } + /** + * + * + *
+     * URI link reference.
+     * 
+ * + * string uri = 1; + * + * @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 ANCHOR_TEXT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object anchorText_ = ""; + /** + * + * + *
+     * Anchor text.
+     * 
+ * + * string anchor_text = 2; + * + * @return The anchorText. + */ + @java.lang.Override + public java.lang.String getAnchorText() { + java.lang.Object ref = anchorText_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + anchorText_ = s; + return s; + } + } + /** + * + * + *
+     * Anchor text.
+     * 
+ * + * string anchor_text = 2; + * + * @return The bytes for anchorText. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAnchorTextBytes() { + java.lang.Object ref = anchorText_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + anchorText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int START_FIELD_NUMBER = 3; + private int start_ = 0; + /** + * + * + *
+     * Anchor text start index.
+     * 
+ * + * int32 start = 3; + * + * @return The start. + */ + @java.lang.Override + public int getStart() { + return start_; + } + + public static final int END_FIELD_NUMBER = 4; + private int end_ = 0; + /** + * + * + *
+     * Anchor text end index.
+     * 
+ * + * int32 end = 4; + * + * @return The end. + */ + @java.lang.Override + public int getEnd() { + return end_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(anchorText_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, anchorText_); + } + if (start_ != 0) { + output.writeInt32(3, start_); + } + if (end_ != 0) { + output.writeInt32(4, end_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(anchorText_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, anchorText_); + } + if (start_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, start_); + } + if (end_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, end_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.Reply.Reference)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.Reply.Reference other = + (com.google.cloud.discoveryengine.v1alpha.Reply.Reference) obj; + + if (!getUri().equals(other.getUri())) return false; + if (!getAnchorText().equals(other.getAnchorText())) return false; + if (getStart() != other.getStart()) return false; + if (getEnd() != other.getEnd()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (37 * hash) + ANCHOR_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getAnchorText().hashCode(); + hash = (37 * hash) + START_FIELD_NUMBER; + hash = (53 * hash) + getStart(); + hash = (37 * hash) + END_FIELD_NUMBER; + hash = (53 * hash) + getEnd(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply.Reference parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply.Reference parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply.Reference parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply.Reference parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply.Reference parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply.Reference parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply.Reference parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply.Reference parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply.Reference parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply.Reference parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply.Reference parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply.Reference parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.Reply.Reference prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Defines reference in reply.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.Reply.Reference} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.Reply.Reference) + com.google.cloud.discoveryengine.v1alpha.Reply.ReferenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_Reply_Reference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_Reply_Reference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.Reply.Reference.class, + com.google.cloud.discoveryengine.v1alpha.Reply.Reference.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.Reply.Reference.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + uri_ = ""; + anchorText_ = ""; + start_ = 0; + end_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_Reply_Reference_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Reply.Reference getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.Reply.Reference.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Reply.Reference build() { + com.google.cloud.discoveryengine.v1alpha.Reply.Reference result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Reply.Reference buildPartial() { + com.google.cloud.discoveryengine.v1alpha.Reply.Reference result = + new com.google.cloud.discoveryengine.v1alpha.Reply.Reference(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.Reply.Reference result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.uri_ = uri_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.anchorText_ = anchorText_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.start_ = start_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.end_ = end_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.Reply.Reference) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.Reply.Reference) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.Reply.Reference other) { + if (other == com.google.cloud.discoveryengine.v1alpha.Reply.Reference.getDefaultInstance()) + return this; + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAnchorText().isEmpty()) { + anchorText_ = other.anchorText_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getStart() != 0) { + setStart(other.getStart()); + } + if (other.getEnd() != 0) { + setEnd(other.getEnd()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + uri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + anchorText_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + start_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + end_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object uri_ = ""; + /** + * + * + *
+       * URI link reference.
+       * 
+ * + * string uri = 1; + * + * @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; + } + } + /** + * + * + *
+       * URI link reference.
+       * 
+ * + * string uri = 1; + * + * @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; + } + } + /** + * + * + *
+       * URI link reference.
+       * 
+ * + * string uri = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * URI link reference.
+       * 
+ * + * string uri = 1; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + uri_ = getDefaultInstance().getUri(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * URI link reference.
+       * 
+ * + * string uri = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object anchorText_ = ""; + /** + * + * + *
+       * Anchor text.
+       * 
+ * + * string anchor_text = 2; + * + * @return The anchorText. + */ + public java.lang.String getAnchorText() { + java.lang.Object ref = anchorText_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + anchorText_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Anchor text.
+       * 
+ * + * string anchor_text = 2; + * + * @return The bytes for anchorText. + */ + public com.google.protobuf.ByteString getAnchorTextBytes() { + java.lang.Object ref = anchorText_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + anchorText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Anchor text.
+       * 
+ * + * string anchor_text = 2; + * + * @param value The anchorText to set. + * @return This builder for chaining. + */ + public Builder setAnchorText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + anchorText_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Anchor text.
+       * 
+ * + * string anchor_text = 2; + * + * @return This builder for chaining. + */ + public Builder clearAnchorText() { + anchorText_ = getDefaultInstance().getAnchorText(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * Anchor text.
+       * 
+ * + * string anchor_text = 2; + * + * @param value The bytes for anchorText to set. + * @return This builder for chaining. + */ + public Builder setAnchorTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + anchorText_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int start_; + /** + * + * + *
+       * Anchor text start index.
+       * 
+ * + * int32 start = 3; + * + * @return The start. + */ + @java.lang.Override + public int getStart() { + return start_; + } + /** + * + * + *
+       * Anchor text start index.
+       * 
+ * + * int32 start = 3; + * + * @param value The start to set. + * @return This builder for chaining. + */ + public Builder setStart(int value) { + + start_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Anchor text start index.
+       * 
+ * + * int32 start = 3; + * + * @return This builder for chaining. + */ + public Builder clearStart() { + bitField0_ = (bitField0_ & ~0x00000004); + start_ = 0; + onChanged(); + return this; + } + + private int end_; + /** + * + * + *
+       * Anchor text end index.
+       * 
+ * + * int32 end = 4; + * + * @return The end. + */ + @java.lang.Override + public int getEnd() { + return end_; + } + /** + * + * + *
+       * Anchor text end index.
+       * 
+ * + * int32 end = 4; + * + * @param value The end to set. + * @return This builder for chaining. + */ + public Builder setEnd(int value) { + + end_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * Anchor text end index.
+       * 
+ * + * int32 end = 4; + * + * @return This builder for chaining. + */ + public Builder clearEnd() { + bitField0_ = (bitField0_ & ~0x00000008); + end_ = 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.discoveryengine.v1alpha.Reply.Reference) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.Reply.Reference) + private static final com.google.cloud.discoveryengine.v1alpha.Reply.Reference DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.Reply.Reference(); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply.Reference getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Reference parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Reply.Reference getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int REPLY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object reply_ = ""; + /** + * + * + *
+   * DEPRECATED: use `summary` instead.
+   * Text reply.
+   * 
+ * + * string reply = 1 [deprecated = true]; + * + * @deprecated google.cloud.discoveryengine.v1alpha.Reply.reply is deprecated. See + * google/cloud/discoveryengine/v1alpha/conversation.proto;l=95 + * @return The reply. + */ + @java.lang.Override + @java.lang.Deprecated + public java.lang.String getReply() { + java.lang.Object ref = reply_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + reply_ = s; + return s; + } + } + /** + * + * + *
+   * DEPRECATED: use `summary` instead.
+   * Text reply.
+   * 
+ * + * string reply = 1 [deprecated = true]; + * + * @deprecated google.cloud.discoveryengine.v1alpha.Reply.reply is deprecated. See + * google/cloud/discoveryengine/v1alpha/conversation.proto;l=95 + * @return The bytes for reply. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.protobuf.ByteString getReplyBytes() { + java.lang.Object ref = reply_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reply_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REFERENCES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List references_; + /** + * + * + *
+   * References in the reply.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.List + getReferencesList() { + return references_; + } + /** + * + * + *
+   * References in the reply.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.List + getReferencesOrBuilderList() { + return references_; + } + /** + * + * + *
+   * References in the reply.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Override + @java.lang.Deprecated + public int getReferencesCount() { + return references_.size(); + } + /** + * + * + *
+   * References in the reply.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.cloud.discoveryengine.v1alpha.Reply.Reference getReferences(int index) { + return references_.get(index); + } + /** + * + * + *
+   * References in the reply.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.cloud.discoveryengine.v1alpha.Reply.ReferenceOrBuilder getReferencesOrBuilder( + int index) { + return references_.get(index); + } + + public static final int SUMMARY_FIELD_NUMBER = 3; + private com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary_; + /** + * + * + *
+   * Summary based on search results.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 3; + * + * @return Whether the summary field is set. + */ + @java.lang.Override + public boolean hasSummary() { + return summary_ != null; + } + /** + * + * + *
+   * Summary based on search results.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 3; + * + * @return The summary. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary getSummary() { + return summary_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.getDefaultInstance() + : summary_; + } + /** + * + * + *
+   * Summary based on search results.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 3; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.SummaryOrBuilder + getSummaryOrBuilder() { + return summary_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.getDefaultInstance() + : summary_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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(reply_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, reply_); + } + for (int i = 0; i < references_.size(); i++) { + output.writeMessage(2, references_.get(i)); + } + if (summary_ != null) { + output.writeMessage(3, getSummary()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(reply_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, reply_); + } + for (int i = 0; i < references_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, references_.get(i)); + } + if (summary_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSummary()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.Reply)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.Reply other = + (com.google.cloud.discoveryengine.v1alpha.Reply) obj; + + if (!getReply().equals(other.getReply())) return false; + if (!getReferencesList().equals(other.getReferencesList())) return false; + if (hasSummary() != other.hasSummary()) return false; + if (hasSummary()) { + if (!getSummary().equals(other.getSummary())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REPLY_FIELD_NUMBER; + hash = (53 * hash) + getReply().hashCode(); + if (getReferencesCount() > 0) { + hash = (37 * hash) + REFERENCES_FIELD_NUMBER; + hash = (53 * hash) + getReferencesList().hashCode(); + } + if (hasSummary()) { + hash = (37 * hash) + SUMMARY_FIELD_NUMBER; + hash = (53 * hash) + getSummary().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.discoveryengine.v1alpha.Reply prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Defines a reply message to user.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.Reply} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.Reply) + com.google.cloud.discoveryengine.v1alpha.ReplyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_Reply_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_Reply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.Reply.class, + com.google.cloud.discoveryengine.v1alpha.Reply.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.Reply.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + reply_ = ""; + if (referencesBuilder_ == null) { + references_ = java.util.Collections.emptyList(); + } else { + references_ = null; + referencesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + summary_ = null; + if (summaryBuilder_ != null) { + summaryBuilder_.dispose(); + summaryBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_Reply_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Reply getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.Reply.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Reply build() { + com.google.cloud.discoveryengine.v1alpha.Reply result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Reply buildPartial() { + com.google.cloud.discoveryengine.v1alpha.Reply result = + new com.google.cloud.discoveryengine.v1alpha.Reply(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.discoveryengine.v1alpha.Reply result) { + if (referencesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + references_ = java.util.Collections.unmodifiableList(references_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.references_ = references_; + } else { + result.references_ = referencesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.Reply result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.reply_ = reply_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.summary_ = summaryBuilder_ == null ? summary_ : summaryBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.Reply) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.Reply) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.Reply other) { + if (other == com.google.cloud.discoveryengine.v1alpha.Reply.getDefaultInstance()) return this; + if (!other.getReply().isEmpty()) { + reply_ = other.reply_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (referencesBuilder_ == null) { + if (!other.references_.isEmpty()) { + if (references_.isEmpty()) { + references_ = other.references_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureReferencesIsMutable(); + references_.addAll(other.references_); + } + onChanged(); + } + } else { + if (!other.references_.isEmpty()) { + if (referencesBuilder_.isEmpty()) { + referencesBuilder_.dispose(); + referencesBuilder_ = null; + references_ = other.references_; + bitField0_ = (bitField0_ & ~0x00000002); + referencesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getReferencesFieldBuilder() + : null; + } else { + referencesBuilder_.addAllMessages(other.references_); + } + } + } + if (other.hasSummary()) { + mergeSummary(other.getSummary()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + reply_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.discoveryengine.v1alpha.Reply.Reference m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.Reply.Reference.parser(), + extensionRegistry); + if (referencesBuilder_ == null) { + ensureReferencesIsMutable(); + references_.add(m); + } else { + referencesBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + input.readMessage(getSummaryFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object reply_ = ""; + /** + * + * + *
+     * DEPRECATED: use `summary` instead.
+     * Text reply.
+     * 
+ * + * string reply = 1 [deprecated = true]; + * + * @deprecated google.cloud.discoveryengine.v1alpha.Reply.reply is deprecated. See + * google/cloud/discoveryengine/v1alpha/conversation.proto;l=95 + * @return The reply. + */ + @java.lang.Deprecated + public java.lang.String getReply() { + java.lang.Object ref = reply_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + reply_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * DEPRECATED: use `summary` instead.
+     * Text reply.
+     * 
+ * + * string reply = 1 [deprecated = true]; + * + * @deprecated google.cloud.discoveryengine.v1alpha.Reply.reply is deprecated. See + * google/cloud/discoveryengine/v1alpha/conversation.proto;l=95 + * @return The bytes for reply. + */ + @java.lang.Deprecated + public com.google.protobuf.ByteString getReplyBytes() { + java.lang.Object ref = reply_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reply_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * DEPRECATED: use `summary` instead.
+     * Text reply.
+     * 
+ * + * string reply = 1 [deprecated = true]; + * + * @deprecated google.cloud.discoveryengine.v1alpha.Reply.reply is deprecated. See + * google/cloud/discoveryengine/v1alpha/conversation.proto;l=95 + * @param value The reply to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setReply(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + reply_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * DEPRECATED: use `summary` instead.
+     * Text reply.
+     * 
+ * + * string reply = 1 [deprecated = true]; + * + * @deprecated google.cloud.discoveryengine.v1alpha.Reply.reply is deprecated. See + * google/cloud/discoveryengine/v1alpha/conversation.proto;l=95 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearReply() { + reply_ = getDefaultInstance().getReply(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * DEPRECATED: use `summary` instead.
+     * Text reply.
+     * 
+ * + * string reply = 1 [deprecated = true]; + * + * @deprecated google.cloud.discoveryengine.v1alpha.Reply.reply is deprecated. See + * google/cloud/discoveryengine/v1alpha/conversation.proto;l=95 + * @param value The bytes for reply to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setReplyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + reply_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List references_ = + java.util.Collections.emptyList(); + + private void ensureReferencesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + references_ = + new java.util.ArrayList( + references_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Reply.Reference, + com.google.cloud.discoveryengine.v1alpha.Reply.Reference.Builder, + com.google.cloud.discoveryengine.v1alpha.Reply.ReferenceOrBuilder> + referencesBuilder_; + + /** + * + * + *
+     * References in the reply.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public java.util.List + getReferencesList() { + if (referencesBuilder_ == null) { + return java.util.Collections.unmodifiableList(references_); + } else { + return referencesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * References in the reply.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public int getReferencesCount() { + if (referencesBuilder_ == null) { + return references_.size(); + } else { + return referencesBuilder_.getCount(); + } + } + /** + * + * + *
+     * References in the reply.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.cloud.discoveryengine.v1alpha.Reply.Reference getReferences(int index) { + if (referencesBuilder_ == null) { + return references_.get(index); + } else { + return referencesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * References in the reply.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setReferences( + int index, com.google.cloud.discoveryengine.v1alpha.Reply.Reference value) { + if (referencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferencesIsMutable(); + references_.set(index, value); + onChanged(); + } else { + referencesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * References in the reply.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder setReferences( + int index, + com.google.cloud.discoveryengine.v1alpha.Reply.Reference.Builder builderForValue) { + if (referencesBuilder_ == null) { + ensureReferencesIsMutable(); + references_.set(index, builderForValue.build()); + onChanged(); + } else { + referencesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * References in the reply.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder addReferences(com.google.cloud.discoveryengine.v1alpha.Reply.Reference value) { + if (referencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferencesIsMutable(); + references_.add(value); + onChanged(); + } else { + referencesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * References in the reply.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder addReferences( + int index, com.google.cloud.discoveryengine.v1alpha.Reply.Reference value) { + if (referencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferencesIsMutable(); + references_.add(index, value); + onChanged(); + } else { + referencesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * References in the reply.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder addReferences( + com.google.cloud.discoveryengine.v1alpha.Reply.Reference.Builder builderForValue) { + if (referencesBuilder_ == null) { + ensureReferencesIsMutable(); + references_.add(builderForValue.build()); + onChanged(); + } else { + referencesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * References in the reply.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder addReferences( + int index, + com.google.cloud.discoveryengine.v1alpha.Reply.Reference.Builder builderForValue) { + if (referencesBuilder_ == null) { + ensureReferencesIsMutable(); + references_.add(index, builderForValue.build()); + onChanged(); + } else { + referencesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * References in the reply.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder addAllReferences( + java.lang.Iterable + values) { + if (referencesBuilder_ == null) { + ensureReferencesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, references_); + onChanged(); + } else { + referencesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * References in the reply.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder clearReferences() { + if (referencesBuilder_ == null) { + references_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + referencesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * References in the reply.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public Builder removeReferences(int index) { + if (referencesBuilder_ == null) { + ensureReferencesIsMutable(); + references_.remove(index); + onChanged(); + } else { + referencesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * References in the reply.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.cloud.discoveryengine.v1alpha.Reply.Reference.Builder getReferencesBuilder( + int index) { + return getReferencesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * References in the reply.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.cloud.discoveryengine.v1alpha.Reply.ReferenceOrBuilder getReferencesOrBuilder( + int index) { + if (referencesBuilder_ == null) { + return references_.get(index); + } else { + return referencesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * References in the reply.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public java.util.List< + ? extends com.google.cloud.discoveryengine.v1alpha.Reply.ReferenceOrBuilder> + getReferencesOrBuilderList() { + if (referencesBuilder_ != null) { + return referencesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(references_); + } + } + /** + * + * + *
+     * References in the reply.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.cloud.discoveryengine.v1alpha.Reply.Reference.Builder addReferencesBuilder() { + return getReferencesFieldBuilder() + .addBuilder( + com.google.cloud.discoveryengine.v1alpha.Reply.Reference.getDefaultInstance()); + } + /** + * + * + *
+     * References in the reply.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public com.google.cloud.discoveryengine.v1alpha.Reply.Reference.Builder addReferencesBuilder( + int index) { + return getReferencesFieldBuilder() + .addBuilder( + index, com.google.cloud.discoveryengine.v1alpha.Reply.Reference.getDefaultInstance()); + } + /** + * + * + *
+     * References in the reply.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + public java.util.List + getReferencesBuilderList() { + return getReferencesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Reply.Reference, + com.google.cloud.discoveryengine.v1alpha.Reply.Reference.Builder, + com.google.cloud.discoveryengine.v1alpha.Reply.ReferenceOrBuilder> + getReferencesFieldBuilder() { + if (referencesBuilder_ == null) { + referencesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Reply.Reference, + com.google.cloud.discoveryengine.v1alpha.Reply.Reference.Builder, + com.google.cloud.discoveryengine.v1alpha.Reply.ReferenceOrBuilder>( + references_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + references_ = null; + } + return referencesBuilder_; + } + + private com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SummaryOrBuilder> + summaryBuilder_; + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 3; + * + * @return Whether the summary field is set. + */ + public boolean hasSummary() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 3; + * + * @return The summary. + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary getSummary() { + if (summaryBuilder_ == null) { + return summary_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.getDefaultInstance() + : summary_; + } else { + return summaryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 3; + */ + public Builder setSummary( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary value) { + if (summaryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + summary_ = value; + } else { + summaryBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 3; + */ + public Builder setSummary( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Builder builderForValue) { + if (summaryBuilder_ == null) { + summary_ = builderForValue.build(); + } else { + summaryBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 3; + */ + public Builder mergeSummary( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary value) { + if (summaryBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && summary_ != null + && summary_ + != com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary + .getDefaultInstance()) { + getSummaryBuilder().mergeFrom(value); + } else { + summary_ = value; + } + } else { + summaryBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 3; + */ + public Builder clearSummary() { + bitField0_ = (bitField0_ & ~0x00000004); + summary_ = null; + if (summaryBuilder_ != null) { + summaryBuilder_.dispose(); + summaryBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 3; + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Builder + getSummaryBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getSummaryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 3; + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.SummaryOrBuilder + getSummaryOrBuilder() { + if (summaryBuilder_ != null) { + return summaryBuilder_.getMessageOrBuilder(); + } else { + return summary_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.getDefaultInstance() + : summary_; + } + } + /** + * + * + *
+     * Summary based on search results.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SummaryOrBuilder> + getSummaryFieldBuilder() { + if (summaryBuilder_ == null) { + summaryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SummaryOrBuilder>( + getSummary(), getParentForChildren(), isClean()); + summary_ = null; + } + return summaryBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.Reply) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.Reply) + private static final com.google.cloud.discoveryengine.v1alpha.Reply DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.Reply(); + } + + public static com.google.cloud.discoveryengine.v1alpha.Reply getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Reply parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Reply getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ReplyOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ReplyOrBuilder.java new file mode 100644 index 000000000000..22c91d86dd49 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ReplyOrBuilder.java @@ -0,0 +1,161 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversation.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface ReplyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.Reply) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * DEPRECATED: use `summary` instead.
+   * Text reply.
+   * 
+ * + * string reply = 1 [deprecated = true]; + * + * @deprecated google.cloud.discoveryengine.v1alpha.Reply.reply is deprecated. See + * google/cloud/discoveryengine/v1alpha/conversation.proto;l=95 + * @return The reply. + */ + @java.lang.Deprecated + java.lang.String getReply(); + /** + * + * + *
+   * DEPRECATED: use `summary` instead.
+   * Text reply.
+   * 
+ * + * string reply = 1 [deprecated = true]; + * + * @deprecated google.cloud.discoveryengine.v1alpha.Reply.reply is deprecated. See + * google/cloud/discoveryengine/v1alpha/conversation.proto;l=95 + * @return The bytes for reply. + */ + @java.lang.Deprecated + com.google.protobuf.ByteString getReplyBytes(); + + /** + * + * + *
+   * References in the reply.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + java.util.List getReferencesList(); + /** + * + * + *
+   * References in the reply.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + com.google.cloud.discoveryengine.v1alpha.Reply.Reference getReferences(int index); + /** + * + * + *
+   * References in the reply.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + int getReferencesCount(); + /** + * + * + *
+   * References in the reply.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + java.util.List + getReferencesOrBuilderList(); + /** + * + * + *
+   * References in the reply.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.Reply.Reference references = 2 [deprecated = true]; + * + */ + @java.lang.Deprecated + com.google.cloud.discoveryengine.v1alpha.Reply.ReferenceOrBuilder getReferencesOrBuilder( + int index); + + /** + * + * + *
+   * Summary based on search results.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 3; + * + * @return Whether the summary field is set. + */ + boolean hasSummary(); + /** + * + * + *
+   * Summary based on search results.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 3; + * + * @return The summary. + */ + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary getSummary(); + /** + * + * + *
+   * Summary based on search results.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 3; + */ + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SummaryOrBuilder getSummaryOrBuilder(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/Schema.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/Schema.java new file mode 100644 index 000000000000..b04271e3f2ae --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/Schema.java @@ -0,0 +1,1808 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Defines the structure and layout of a type of document data.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.Schema} + */ +public final class Schema extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.Schema) + SchemaOrBuilder { + private static final long serialVersionUID = 0L; + // Use Schema.newBuilder() to construct. + private Schema(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Schema() { + name_ = ""; + fieldConfigs_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Schema(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaProto + .internal_static_google_cloud_discoveryengine_v1alpha_Schema_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SchemaProto + .internal_static_google_cloud_discoveryengine_v1alpha_Schema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.Schema.class, + com.google.cloud.discoveryengine.v1alpha.Schema.Builder.class); + } + + private int schemaCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object schema_; + + public enum SchemaCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STRUCT_SCHEMA(2), + JSON_SCHEMA(3), + SCHEMA_NOT_SET(0); + private final int value; + + private SchemaCase(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 SchemaCase valueOf(int value) { + return forNumber(value); + } + + public static SchemaCase forNumber(int value) { + switch (value) { + case 2: + return STRUCT_SCHEMA; + case 3: + return JSON_SCHEMA; + case 0: + return SCHEMA_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SchemaCase getSchemaCase() { + return SchemaCase.forNumber(schemaCase_); + } + + public static final int STRUCT_SCHEMA_FIELD_NUMBER = 2; + /** + * + * + *
+   * The structured representation of the schema.
+   * 
+ * + * .google.protobuf.Struct struct_schema = 2; + * + * @return Whether the structSchema field is set. + */ + @java.lang.Override + public boolean hasStructSchema() { + return schemaCase_ == 2; + } + /** + * + * + *
+   * The structured representation of the schema.
+   * 
+ * + * .google.protobuf.Struct struct_schema = 2; + * + * @return The structSchema. + */ + @java.lang.Override + public com.google.protobuf.Struct getStructSchema() { + if (schemaCase_ == 2) { + return (com.google.protobuf.Struct) schema_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + /** + * + * + *
+   * The structured representation of the schema.
+   * 
+ * + * .google.protobuf.Struct struct_schema = 2; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getStructSchemaOrBuilder() { + if (schemaCase_ == 2) { + return (com.google.protobuf.Struct) schema_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + + public static final int JSON_SCHEMA_FIELD_NUMBER = 3; + /** + * + * + *
+   * The JSON representation of the schema.
+   * 
+ * + * string json_schema = 3; + * + * @return Whether the jsonSchema field is set. + */ + public boolean hasJsonSchema() { + return schemaCase_ == 3; + } + /** + * + * + *
+   * The JSON representation of the schema.
+   * 
+ * + * string json_schema = 3; + * + * @return The jsonSchema. + */ + public java.lang.String getJsonSchema() { + java.lang.Object ref = ""; + if (schemaCase_ == 3) { + ref = schema_; + } + if (ref instanceof java.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 (schemaCase_ == 3) { + schema_ = s; + } + return s; + } + } + /** + * + * + *
+   * The JSON representation of the schema.
+   * 
+ * + * string json_schema = 3; + * + * @return The bytes for jsonSchema. + */ + public com.google.protobuf.ByteString getJsonSchemaBytes() { + java.lang.Object ref = ""; + if (schemaCase_ == 3) { + ref = schema_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (schemaCase_ == 3) { + schema_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Immutable. The full resource name of the schema, in the format of
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+   *
+   * This field must be a UTF-8 encoded string with a length limit of 1024
+   * characters.
+   * 
+ * + * 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. The full resource name of the schema, in the format of
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+   *
+   * This field must be a UTF-8 encoded string with a length limit of 1024
+   * characters.
+   * 
+ * + * 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 FIELD_CONFIGS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List fieldConfigs_; + /** + * + * + *
+   * Output only. Configurations for fields of the schema.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getFieldConfigsList() { + return fieldConfigs_; + } + /** + * + * + *
+   * Output only. Configurations for fields of the schema.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getFieldConfigsOrBuilderList() { + return fieldConfigs_; + } + /** + * + * + *
+   * Output only. Configurations for fields of the schema.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getFieldConfigsCount() { + return fieldConfigs_.size(); + } + /** + * + * + *
+   * Output only. Configurations for fields of the schema.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.FieldConfig getFieldConfigs(int index) { + return fieldConfigs_.get(index); + } + /** + * + * + *
+   * Output only. Configurations for fields of the schema.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.FieldConfigOrBuilder getFieldConfigsOrBuilder( + int index) { + return fieldConfigs_.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 (schemaCase_ == 2) { + output.writeMessage(2, (com.google.protobuf.Struct) schema_); + } + if (schemaCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, schema_); + } + for (int i = 0; i < fieldConfigs_.size(); i++) { + output.writeMessage(4, fieldConfigs_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (schemaCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.protobuf.Struct) schema_); + } + if (schemaCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, schema_); + } + for (int i = 0; i < fieldConfigs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, fieldConfigs_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.Schema)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.Schema other = + (com.google.cloud.discoveryengine.v1alpha.Schema) obj; + + if (!getName().equals(other.getName())) return false; + if (!getFieldConfigsList().equals(other.getFieldConfigsList())) return false; + if (!getSchemaCase().equals(other.getSchemaCase())) return false; + switch (schemaCase_) { + case 2: + if (!getStructSchema().equals(other.getStructSchema())) return false; + break; + case 3: + if (!getJsonSchema().equals(other.getJsonSchema())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getFieldConfigsCount() > 0) { + hash = (37 * hash) + FIELD_CONFIGS_FIELD_NUMBER; + hash = (53 * hash) + getFieldConfigsList().hashCode(); + } + switch (schemaCase_) { + case 2: + hash = (37 * hash) + STRUCT_SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getStructSchema().hashCode(); + break; + case 3: + hash = (37 * hash) + JSON_SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getJsonSchema().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.Schema parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.Schema parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Schema parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.Schema parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Schema parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.Schema parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Schema parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.Schema parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Schema parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.Schema parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.Schema parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.Schema parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.discoveryengine.v1alpha.Schema prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Defines the structure and layout of a type of document data.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.Schema} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.Schema) + com.google.cloud.discoveryengine.v1alpha.SchemaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaProto + .internal_static_google_cloud_discoveryengine_v1alpha_Schema_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SchemaProto + .internal_static_google_cloud_discoveryengine_v1alpha_Schema_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.Schema.class, + com.google.cloud.discoveryengine.v1alpha.Schema.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.Schema.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (structSchemaBuilder_ != null) { + structSchemaBuilder_.clear(); + } + name_ = ""; + if (fieldConfigsBuilder_ == null) { + fieldConfigs_ = java.util.Collections.emptyList(); + } else { + fieldConfigs_ = null; + fieldConfigsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + schemaCase_ = 0; + schema_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SchemaProto + .internal_static_google_cloud_discoveryengine_v1alpha_Schema_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Schema getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.Schema.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Schema build() { + com.google.cloud.discoveryengine.v1alpha.Schema result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Schema buildPartial() { + com.google.cloud.discoveryengine.v1alpha.Schema result = + new com.google.cloud.discoveryengine.v1alpha.Schema(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.Schema result) { + if (fieldConfigsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + fieldConfigs_ = java.util.Collections.unmodifiableList(fieldConfigs_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.fieldConfigs_ = fieldConfigs_; + } else { + result.fieldConfigs_ = fieldConfigsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.Schema result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + } + + private void buildPartialOneofs(com.google.cloud.discoveryengine.v1alpha.Schema result) { + result.schemaCase_ = schemaCase_; + result.schema_ = this.schema_; + if (schemaCase_ == 2 && structSchemaBuilder_ != null) { + result.schema_ = structSchemaBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.Schema) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.Schema) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.Schema other) { + if (other == com.google.cloud.discoveryengine.v1alpha.Schema.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (fieldConfigsBuilder_ == null) { + if (!other.fieldConfigs_.isEmpty()) { + if (fieldConfigs_.isEmpty()) { + fieldConfigs_ = other.fieldConfigs_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureFieldConfigsIsMutable(); + fieldConfigs_.addAll(other.fieldConfigs_); + } + onChanged(); + } + } else { + if (!other.fieldConfigs_.isEmpty()) { + if (fieldConfigsBuilder_.isEmpty()) { + fieldConfigsBuilder_.dispose(); + fieldConfigsBuilder_ = null; + fieldConfigs_ = other.fieldConfigs_; + bitField0_ = (bitField0_ & ~0x00000008); + fieldConfigsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFieldConfigsFieldBuilder() + : null; + } else { + fieldConfigsBuilder_.addAllMessages(other.fieldConfigs_); + } + } + } + switch (other.getSchemaCase()) { + case STRUCT_SCHEMA: + { + mergeStructSchema(other.getStructSchema()); + break; + } + case JSON_SCHEMA: + { + schemaCase_ = 3; + schema_ = other.schema_; + onChanged(); + break; + } + case SCHEMA_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 10 + case 18: + { + input.readMessage(getStructSchemaFieldBuilder().getBuilder(), extensionRegistry); + schemaCase_ = 2; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + schemaCase_ = 3; + schema_ = s; + break; + } // case 26 + case 34: + { + com.google.cloud.discoveryengine.v1alpha.FieldConfig m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.FieldConfig.parser(), + extensionRegistry); + if (fieldConfigsBuilder_ == null) { + ensureFieldConfigsIsMutable(); + fieldConfigs_.add(m); + } else { + fieldConfigsBuilder_.addMessage(m); + } + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int schemaCase_ = 0; + private java.lang.Object schema_; + + public SchemaCase getSchemaCase() { + return SchemaCase.forNumber(schemaCase_); + } + + public Builder clearSchema() { + schemaCase_ = 0; + schema_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + structSchemaBuilder_; + /** + * + * + *
+     * The structured representation of the schema.
+     * 
+ * + * .google.protobuf.Struct struct_schema = 2; + * + * @return Whether the structSchema field is set. + */ + @java.lang.Override + public boolean hasStructSchema() { + return schemaCase_ == 2; + } + /** + * + * + *
+     * The structured representation of the schema.
+     * 
+ * + * .google.protobuf.Struct struct_schema = 2; + * + * @return The structSchema. + */ + @java.lang.Override + public com.google.protobuf.Struct getStructSchema() { + if (structSchemaBuilder_ == null) { + if (schemaCase_ == 2) { + return (com.google.protobuf.Struct) schema_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } else { + if (schemaCase_ == 2) { + return structSchemaBuilder_.getMessage(); + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + } + /** + * + * + *
+     * The structured representation of the schema.
+     * 
+ * + * .google.protobuf.Struct struct_schema = 2; + */ + public Builder setStructSchema(com.google.protobuf.Struct value) { + if (structSchemaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schema_ = value; + onChanged(); + } else { + structSchemaBuilder_.setMessage(value); + } + schemaCase_ = 2; + return this; + } + /** + * + * + *
+     * The structured representation of the schema.
+     * 
+ * + * .google.protobuf.Struct struct_schema = 2; + */ + public Builder setStructSchema(com.google.protobuf.Struct.Builder builderForValue) { + if (structSchemaBuilder_ == null) { + schema_ = builderForValue.build(); + onChanged(); + } else { + structSchemaBuilder_.setMessage(builderForValue.build()); + } + schemaCase_ = 2; + return this; + } + /** + * + * + *
+     * The structured representation of the schema.
+     * 
+ * + * .google.protobuf.Struct struct_schema = 2; + */ + public Builder mergeStructSchema(com.google.protobuf.Struct value) { + if (structSchemaBuilder_ == null) { + if (schemaCase_ == 2 && schema_ != com.google.protobuf.Struct.getDefaultInstance()) { + schema_ = + com.google.protobuf.Struct.newBuilder((com.google.protobuf.Struct) schema_) + .mergeFrom(value) + .buildPartial(); + } else { + schema_ = value; + } + onChanged(); + } else { + if (schemaCase_ == 2) { + structSchemaBuilder_.mergeFrom(value); + } else { + structSchemaBuilder_.setMessage(value); + } + } + schemaCase_ = 2; + return this; + } + /** + * + * + *
+     * The structured representation of the schema.
+     * 
+ * + * .google.protobuf.Struct struct_schema = 2; + */ + public Builder clearStructSchema() { + if (structSchemaBuilder_ == null) { + if (schemaCase_ == 2) { + schemaCase_ = 0; + schema_ = null; + onChanged(); + } + } else { + if (schemaCase_ == 2) { + schemaCase_ = 0; + schema_ = null; + } + structSchemaBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The structured representation of the schema.
+     * 
+ * + * .google.protobuf.Struct struct_schema = 2; + */ + public com.google.protobuf.Struct.Builder getStructSchemaBuilder() { + return getStructSchemaFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The structured representation of the schema.
+     * 
+ * + * .google.protobuf.Struct struct_schema = 2; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getStructSchemaOrBuilder() { + if ((schemaCase_ == 2) && (structSchemaBuilder_ != null)) { + return structSchemaBuilder_.getMessageOrBuilder(); + } else { + if (schemaCase_ == 2) { + return (com.google.protobuf.Struct) schema_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + } + /** + * + * + *
+     * The structured representation of the schema.
+     * 
+ * + * .google.protobuf.Struct struct_schema = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getStructSchemaFieldBuilder() { + if (structSchemaBuilder_ == null) { + if (!(schemaCase_ == 2)) { + schema_ = com.google.protobuf.Struct.getDefaultInstance(); + } + structSchemaBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + (com.google.protobuf.Struct) schema_, getParentForChildren(), isClean()); + schema_ = null; + } + schemaCase_ = 2; + onChanged(); + return structSchemaBuilder_; + } + + /** + * + * + *
+     * The JSON representation of the schema.
+     * 
+ * + * string json_schema = 3; + * + * @return Whether the jsonSchema field is set. + */ + @java.lang.Override + public boolean hasJsonSchema() { + return schemaCase_ == 3; + } + /** + * + * + *
+     * The JSON representation of the schema.
+     * 
+ * + * string json_schema = 3; + * + * @return The jsonSchema. + */ + @java.lang.Override + public java.lang.String getJsonSchema() { + java.lang.Object ref = ""; + if (schemaCase_ == 3) { + ref = schema_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (schemaCase_ == 3) { + schema_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The JSON representation of the schema.
+     * 
+ * + * string json_schema = 3; + * + * @return The bytes for jsonSchema. + */ + @java.lang.Override + public com.google.protobuf.ByteString getJsonSchemaBytes() { + java.lang.Object ref = ""; + if (schemaCase_ == 3) { + ref = schema_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (schemaCase_ == 3) { + schema_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The JSON representation of the schema.
+     * 
+ * + * string json_schema = 3; + * + * @param value The jsonSchema to set. + * @return This builder for chaining. + */ + public Builder setJsonSchema(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + schemaCase_ = 3; + schema_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The JSON representation of the schema.
+     * 
+ * + * string json_schema = 3; + * + * @return This builder for chaining. + */ + public Builder clearJsonSchema() { + if (schemaCase_ == 3) { + schemaCase_ = 0; + schema_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The JSON representation of the schema.
+     * 
+ * + * string json_schema = 3; + * + * @param value The bytes for jsonSchema to set. + * @return This builder for chaining. + */ + public Builder setJsonSchemaBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + schemaCase_ = 3; + schema_ = value; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. The full resource name of the schema, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+     *
+     * This field must be a UTF-8 encoded string with a length limit of 1024
+     * characters.
+     * 
+ * + * 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. The full resource name of the schema, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+     *
+     * This field must be a UTF-8 encoded string with a length limit of 1024
+     * characters.
+     * 
+ * + * 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. The full resource name of the schema, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+     *
+     * This field must be a UTF-8 encoded string with a length limit of 1024
+     * characters.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The full resource name of the schema, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+     *
+     * This field must be a UTF-8 encoded string with a length limit of 1024
+     * characters.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The full resource name of the schema, in the format of
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+     *
+     * This field must be a UTF-8 encoded string with a length limit of 1024
+     * characters.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.util.List fieldConfigs_ = + java.util.Collections.emptyList(); + + private void ensureFieldConfigsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + fieldConfigs_ = + new java.util.ArrayList( + fieldConfigs_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.FieldConfig, + com.google.cloud.discoveryengine.v1alpha.FieldConfig.Builder, + com.google.cloud.discoveryengine.v1alpha.FieldConfigOrBuilder> + fieldConfigsBuilder_; + + /** + * + * + *
+     * Output only. Configurations for fields of the schema.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getFieldConfigsList() { + if (fieldConfigsBuilder_ == null) { + return java.util.Collections.unmodifiableList(fieldConfigs_); + } else { + return fieldConfigsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Configurations for fields of the schema.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getFieldConfigsCount() { + if (fieldConfigsBuilder_ == null) { + return fieldConfigs_.size(); + } else { + return fieldConfigsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Configurations for fields of the schema.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.FieldConfig getFieldConfigs(int index) { + if (fieldConfigsBuilder_ == null) { + return fieldConfigs_.get(index); + } else { + return fieldConfigsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Configurations for fields of the schema.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setFieldConfigs( + int index, com.google.cloud.discoveryengine.v1alpha.FieldConfig value) { + if (fieldConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldConfigsIsMutable(); + fieldConfigs_.set(index, value); + onChanged(); + } else { + fieldConfigsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Configurations for fields of the schema.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setFieldConfigs( + int index, com.google.cloud.discoveryengine.v1alpha.FieldConfig.Builder builderForValue) { + if (fieldConfigsBuilder_ == null) { + ensureFieldConfigsIsMutable(); + fieldConfigs_.set(index, builderForValue.build()); + onChanged(); + } else { + fieldConfigsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Configurations for fields of the schema.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addFieldConfigs(com.google.cloud.discoveryengine.v1alpha.FieldConfig value) { + if (fieldConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldConfigsIsMutable(); + fieldConfigs_.add(value); + onChanged(); + } else { + fieldConfigsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Configurations for fields of the schema.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addFieldConfigs( + int index, com.google.cloud.discoveryengine.v1alpha.FieldConfig value) { + if (fieldConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldConfigsIsMutable(); + fieldConfigs_.add(index, value); + onChanged(); + } else { + fieldConfigsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Configurations for fields of the schema.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addFieldConfigs( + com.google.cloud.discoveryengine.v1alpha.FieldConfig.Builder builderForValue) { + if (fieldConfigsBuilder_ == null) { + ensureFieldConfigsIsMutable(); + fieldConfigs_.add(builderForValue.build()); + onChanged(); + } else { + fieldConfigsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Configurations for fields of the schema.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addFieldConfigs( + int index, com.google.cloud.discoveryengine.v1alpha.FieldConfig.Builder builderForValue) { + if (fieldConfigsBuilder_ == null) { + ensureFieldConfigsIsMutable(); + fieldConfigs_.add(index, builderForValue.build()); + onChanged(); + } else { + fieldConfigsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Configurations for fields of the schema.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllFieldConfigs( + java.lang.Iterable values) { + if (fieldConfigsBuilder_ == null) { + ensureFieldConfigsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, fieldConfigs_); + onChanged(); + } else { + fieldConfigsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Configurations for fields of the schema.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearFieldConfigs() { + if (fieldConfigsBuilder_ == null) { + fieldConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + fieldConfigsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Configurations for fields of the schema.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeFieldConfigs(int index) { + if (fieldConfigsBuilder_ == null) { + ensureFieldConfigsIsMutable(); + fieldConfigs_.remove(index); + onChanged(); + } else { + fieldConfigsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Configurations for fields of the schema.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.FieldConfig.Builder getFieldConfigsBuilder( + int index) { + return getFieldConfigsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Configurations for fields of the schema.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.FieldConfigOrBuilder getFieldConfigsOrBuilder( + int index) { + if (fieldConfigsBuilder_ == null) { + return fieldConfigs_.get(index); + } else { + return fieldConfigsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Configurations for fields of the schema.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getFieldConfigsOrBuilderList() { + if (fieldConfigsBuilder_ != null) { + return fieldConfigsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(fieldConfigs_); + } + } + /** + * + * + *
+     * Output only. Configurations for fields of the schema.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.FieldConfig.Builder addFieldConfigsBuilder() { + return getFieldConfigsFieldBuilder() + .addBuilder(com.google.cloud.discoveryengine.v1alpha.FieldConfig.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Configurations for fields of the schema.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.FieldConfig.Builder addFieldConfigsBuilder( + int index) { + return getFieldConfigsFieldBuilder() + .addBuilder( + index, com.google.cloud.discoveryengine.v1alpha.FieldConfig.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Configurations for fields of the schema.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getFieldConfigsBuilderList() { + return getFieldConfigsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.FieldConfig, + com.google.cloud.discoveryengine.v1alpha.FieldConfig.Builder, + com.google.cloud.discoveryengine.v1alpha.FieldConfigOrBuilder> + getFieldConfigsFieldBuilder() { + if (fieldConfigsBuilder_ == null) { + fieldConfigsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.FieldConfig, + com.google.cloud.discoveryengine.v1alpha.FieldConfig.Builder, + com.google.cloud.discoveryengine.v1alpha.FieldConfigOrBuilder>( + fieldConfigs_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + fieldConfigs_ = null; + } + return fieldConfigsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.Schema) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.Schema) + private static final com.google.cloud.discoveryengine.v1alpha.Schema DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.Schema(); + } + + public static com.google.cloud.discoveryengine.v1alpha.Schema getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Schema parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Schema getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaName.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaName.java new file mode 100644 index 000000000000..b35edde06146 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaName.java @@ -0,0 +1,427 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +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 SchemaName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_DATA_STORE_SCHEMA = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}"); + private static final PathTemplate PROJECT_LOCATION_COLLECTION_DATA_STORE_SCHEMA = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String dataStore; + private final String schema; + private final String collection; + + @Deprecated + protected SchemaName() { + project = null; + location = null; + dataStore = null; + schema = null; + collection = null; + } + + private SchemaName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + dataStore = Preconditions.checkNotNull(builder.getDataStore()); + schema = Preconditions.checkNotNull(builder.getSchema()); + collection = null; + pathTemplate = PROJECT_LOCATION_DATA_STORE_SCHEMA; + } + + private SchemaName(ProjectLocationCollectionDataStoreSchemaBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + collection = Preconditions.checkNotNull(builder.getCollection()); + dataStore = Preconditions.checkNotNull(builder.getDataStore()); + schema = Preconditions.checkNotNull(builder.getSchema()); + pathTemplate = PROJECT_LOCATION_COLLECTION_DATA_STORE_SCHEMA; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataStore() { + return dataStore; + } + + public String getSchema() { + return schema; + } + + public String getCollection() { + return collection; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectLocationDataStoreSchemaBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static ProjectLocationCollectionDataStoreSchemaBuilder + newProjectLocationCollectionDataStoreSchemaBuilder() { + return new ProjectLocationCollectionDataStoreSchemaBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SchemaName of(String project, String location, String dataStore, String schema) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setSchema(schema) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static SchemaName ofProjectLocationDataStoreSchemaName( + String project, String location, String dataStore, String schema) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setSchema(schema) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static SchemaName ofProjectLocationCollectionDataStoreSchemaName( + String project, String location, String collection, String dataStore, String schema) { + return newProjectLocationCollectionDataStoreSchemaBuilder() + .setProject(project) + .setLocation(location) + .setCollection(collection) + .setDataStore(dataStore) + .setSchema(schema) + .build(); + } + + public static String format(String project, String location, String dataStore, String schema) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setSchema(schema) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationDataStoreSchemaName( + String project, String location, String dataStore, String schema) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setSchema(schema) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationCollectionDataStoreSchemaName( + String project, String location, String collection, String dataStore, String schema) { + return newProjectLocationCollectionDataStoreSchemaBuilder() + .setProject(project) + .setLocation(location) + .setCollection(collection) + .setDataStore(dataStore) + .setSchema(schema) + .build() + .toString(); + } + + public static SchemaName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_DATA_STORE_SCHEMA.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_DATA_STORE_SCHEMA.match(formattedString); + return ofProjectLocationDataStoreSchemaName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("data_store"), + matchMap.get("schema")); + } else if (PROJECT_LOCATION_COLLECTION_DATA_STORE_SCHEMA.matches(formattedString)) { + Map matchMap = + PROJECT_LOCATION_COLLECTION_DATA_STORE_SCHEMA.match(formattedString); + return ofProjectLocationCollectionDataStoreSchemaName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("collection"), + matchMap.get("data_store"), + matchMap.get("schema")); + } + throw new ValidationException("SchemaName.parse: formattedString not in valid format"); + } + + 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 (SchemaName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_DATA_STORE_SCHEMA.matches(formattedString) + || PROJECT_LOCATION_COLLECTION_DATA_STORE_SCHEMA.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 (dataStore != null) { + fieldMapBuilder.put("data_store", dataStore); + } + if (schema != null) { + fieldMapBuilder.put("schema", schema); + } + if (collection != null) { + fieldMapBuilder.put("collection", collection); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + SchemaName that = ((SchemaName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.dataStore, that.dataStore) + && Objects.equals(this.schema, that.schema) + && Objects.equals(this.collection, that.collection); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(dataStore); + h *= 1000003; + h ^= Objects.hashCode(schema); + h *= 1000003; + h ^= Objects.hashCode(collection); + return h; + } + + /** + * Builder for projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}. + */ + public static class Builder { + private String project; + private String location; + private String dataStore; + private String schema; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataStore() { + return dataStore; + } + + public String getSchema() { + return schema; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setDataStore(String dataStore) { + this.dataStore = dataStore; + return this; + } + + public Builder setSchema(String schema) { + this.schema = schema; + return this; + } + + private Builder(SchemaName schemaName) { + Preconditions.checkArgument( + Objects.equals(schemaName.pathTemplate, PROJECT_LOCATION_DATA_STORE_SCHEMA), + "toBuilder is only supported when SchemaName has the pattern of projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}"); + this.project = schemaName.project; + this.location = schemaName.location; + this.dataStore = schemaName.dataStore; + this.schema = schemaName.schema; + } + + public SchemaName build() { + return new SchemaName(this); + } + } + + /** + * Builder for + * projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}. + */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class ProjectLocationCollectionDataStoreSchemaBuilder { + private String project; + private String location; + private String collection; + private String dataStore; + private String schema; + + protected ProjectLocationCollectionDataStoreSchemaBuilder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCollection() { + return collection; + } + + public String getDataStore() { + return dataStore; + } + + public String getSchema() { + return schema; + } + + public ProjectLocationCollectionDataStoreSchemaBuilder setProject(String project) { + this.project = project; + return this; + } + + public ProjectLocationCollectionDataStoreSchemaBuilder setLocation(String location) { + this.location = location; + return this; + } + + public ProjectLocationCollectionDataStoreSchemaBuilder setCollection(String collection) { + this.collection = collection; + return this; + } + + public ProjectLocationCollectionDataStoreSchemaBuilder setDataStore(String dataStore) { + this.dataStore = dataStore; + return this; + } + + public ProjectLocationCollectionDataStoreSchemaBuilder setSchema(String schema) { + this.schema = schema; + return this; + } + + public SchemaName build() { + return new SchemaName(this); + } + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaOrBuilder.java new file mode 100644 index 000000000000..570a20380b56 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaOrBuilder.java @@ -0,0 +1,194 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface SchemaOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.Schema) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The structured representation of the schema.
+   * 
+ * + * .google.protobuf.Struct struct_schema = 2; + * + * @return Whether the structSchema field is set. + */ + boolean hasStructSchema(); + /** + * + * + *
+   * The structured representation of the schema.
+   * 
+ * + * .google.protobuf.Struct struct_schema = 2; + * + * @return The structSchema. + */ + com.google.protobuf.Struct getStructSchema(); + /** + * + * + *
+   * The structured representation of the schema.
+   * 
+ * + * .google.protobuf.Struct struct_schema = 2; + */ + com.google.protobuf.StructOrBuilder getStructSchemaOrBuilder(); + + /** + * + * + *
+   * The JSON representation of the schema.
+   * 
+ * + * string json_schema = 3; + * + * @return Whether the jsonSchema field is set. + */ + boolean hasJsonSchema(); + /** + * + * + *
+   * The JSON representation of the schema.
+   * 
+ * + * string json_schema = 3; + * + * @return The jsonSchema. + */ + java.lang.String getJsonSchema(); + /** + * + * + *
+   * The JSON representation of the schema.
+   * 
+ * + * string json_schema = 3; + * + * @return The bytes for jsonSchema. + */ + com.google.protobuf.ByteString getJsonSchemaBytes(); + + /** + * + * + *
+   * Immutable. The full resource name of the schema, in the format of
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+   *
+   * This field must be a UTF-8 encoded string with a length limit of 1024
+   * characters.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. The full resource name of the schema, in the format of
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
+   *
+   * This field must be a UTF-8 encoded string with a length limit of 1024
+   * characters.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Configurations for fields of the schema.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getFieldConfigsList(); + /** + * + * + *
+   * Output only. Configurations for fields of the schema.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.discoveryengine.v1alpha.FieldConfig getFieldConfigs(int index); + /** + * + * + *
+   * Output only. Configurations for fields of the schema.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getFieldConfigsCount(); + /** + * + * + *
+   * Output only. Configurations for fields of the schema.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getFieldConfigsOrBuilderList(); + /** + * + * + *
+   * Output only. Configurations for fields of the schema.
+   * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.FieldConfig field_configs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.discoveryengine.v1alpha.FieldConfigOrBuilder getFieldConfigsOrBuilder(int index); + + com.google.cloud.discoveryengine.v1alpha.Schema.SchemaCase getSchemaCase(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaProto.java new file mode 100644 index 000000000000..4738e79dd3f9 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaProto.java @@ -0,0 +1,153 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public final class SchemaProto { + private SchemaProto() {} + + 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_discoveryengine_v1alpha_Schema_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_Schema_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_FieldConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_FieldConfig_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/discoveryengine/v1alpha/s" + + "chema.proto\022$google.cloud.discoveryengin" + + "e.v1alpha\032\037google/api/field_behavior.pro" + + "to\032\031google/api/resource.proto\032\034google/pr" + + "otobuf/struct.proto\"\252\003\n\006Schema\0220\n\rstruct" + + "_schema\030\002 \001(\0132\027.google.protobuf.StructH\000" + + "\022\025\n\013json_schema\030\003 \001(\tH\000\022\022\n\004name\030\001 \001(\tB\004\342" + + "A\001\005\022N\n\rfield_configs\030\004 \003(\01321.google.clou" + + "d.discoveryengine.v1alpha.FieldConfigB\004\342" + + "A\001\003:\350\001\352A\344\001\n%discoveryengine.googleapis.c" + + "om/Schema\022Pprojects/{project}/locations/" + + "{location}/dataStores/{data_store}/schem" + + "as/{schema}\022iprojects/{project}/location" + + "s/{location}/collections/{collection}/da" + + "taStores/{data_store}/schemas/{schema}B\010" + + "\n\006schema\"\365\013\n\013FieldConfig\022\030\n\nfield_path\030\001" + + " \001(\tB\004\342A\001\002\022U\n\nfield_type\030\002 \001(\0162;.google." + + "cloud.discoveryengine.v1alpha.FieldConfi" + + "g.FieldTypeB\004\342A\001\003\022[\n\020indexable_option\030\003 " + + "\001(\0162A.google.cloud.discoveryengine.v1alp" + + "ha.FieldConfig.IndexableOption\022j\n\030dynami" + + "c_facetable_option\030\004 \001(\0162H.google.cloud." + + "discoveryengine.v1alpha.FieldConfig.Dyna" + + "micFacetableOption\022]\n\021searchable_option\030" + + "\005 \001(\0162B.google.cloud.discoveryengine.v1a" + + "lpha.FieldConfig.SearchableOption\022_\n\022ret" + + "rievable_option\030\006 \001(\0162C.google.cloud.dis" + + "coveryengine.v1alpha.FieldConfig.Retriev" + + "ableOption\022_\n\022completable_option\030\010 \001(\0162C" + + ".google.cloud.discoveryengine.v1alpha.Fi" + + "eldConfig.CompletableOption\022b\n\026recs_filt" + + "erable_option\030\t \001(\0162B.google.cloud.disco" + + "veryengine.v1alpha.FieldConfig.Filterabl" + + "eOption\022\037\n\021key_property_type\030\007 \001(\tB\004\342A\001\003" + + "\"v\n\tFieldType\022\032\n\026FIELD_TYPE_UNSPECIFIED\020" + + "\000\022\n\n\006OBJECT\020\001\022\n\n\006STRING\020\002\022\n\n\006NUMBER\020\003\022\013\n" + + "\007INTEGER\020\004\022\013\n\007BOOLEAN\020\005\022\017\n\013GEOLOCATION\020\006" + + "\"b\n\017IndexableOption\022 \n\034INDEXABLE_OPTION_" + + "UNSPECIFIED\020\000\022\025\n\021INDEXABLE_ENABLED\020\001\022\026\n\022" + + "INDEXABLE_DISABLED\020\002\"\201\001\n\026DynamicFacetabl" + + "eOption\022(\n$DYNAMIC_FACETABLE_OPTION_UNSP" + + "ECIFIED\020\000\022\035\n\031DYNAMIC_FACETABLE_ENABLED\020\001" + + "\022\036\n\032DYNAMIC_FACETABLE_DISABLED\020\002\"f\n\020Sear" + + "chableOption\022!\n\035SEARCHABLE_OPTION_UNSPEC" + + "IFIED\020\000\022\026\n\022SEARCHABLE_ENABLED\020\001\022\027\n\023SEARC" + + "HABLE_DISABLED\020\002\"j\n\021RetrievableOption\022\"\n" + + "\036RETRIEVABLE_OPTION_UNSPECIFIED\020\000\022\027\n\023RET" + + "RIEVABLE_ENABLED\020\001\022\030\n\024RETRIEVABLE_DISABL" + + "ED\020\002\"j\n\021CompletableOption\022\"\n\036COMPLETABLE" + + "_OPTION_UNSPECIFIED\020\000\022\027\n\023COMPLETABLE_ENA" + + "BLED\020\001\022\030\n\024COMPLETABLE_DISABLED\020\002\"f\n\020Filt" + + "erableOption\022!\n\035FILTERABLE_OPTION_UNSPEC" + + "IFIED\020\000\022\026\n\022FILTERABLE_ENABLED\020\001\022\027\n\023FILTE" + + "RABLE_DISABLED\020\002B\227\002\n(com.google.cloud.di" + + "scoveryengine.v1alphaB\013SchemaProtoP\001ZRcl" + + "oud.google.com/go/discoveryengine/apiv1a" + + "lpha/discoveryenginepb;discoveryenginepb" + + "\242\002\017DISCOVERYENGINE\252\002$Google.Cloud.Discov" + + "eryEngine.V1Alpha\312\002$Google\\Cloud\\Discove" + + "ryEngine\\V1alpha\352\002\'Google::Cloud::Discov" + + "eryEngine::V1alphab\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.StructProto.getDescriptor(), + }); + internal_static_google_cloud_discoveryengine_v1alpha_Schema_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_discoveryengine_v1alpha_Schema_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_Schema_descriptor, + new java.lang.String[] { + "StructSchema", "JsonSchema", "Name", "FieldConfigs", "Schema", + }); + internal_static_google_cloud_discoveryengine_v1alpha_FieldConfig_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_discoveryengine_v1alpha_FieldConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_FieldConfig_descriptor, + new java.lang.String[] { + "FieldPath", + "FieldType", + "IndexableOption", + "DynamicFacetableOption", + "SearchableOption", + "RetrievableOption", + "CompletableOption", + "RecsFilterableOption", + "KeyPropertyType", + }); + 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.protobuf.StructProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceProto.java new file mode 100644 index 000000000000..1d4a2a7d23bc --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SchemaServiceProto.java @@ -0,0 +1,272 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public final class SchemaServiceProto { + private SchemaServiceProto() {} + + 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_discoveryengine_v1alpha_GetSchemaRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_GetSchemaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_ListSchemasRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_ListSchemasRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_ListSchemasResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_ListSchemasResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_CreateSchemaRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_CreateSchemaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_UpdateSchemaRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_UpdateSchemaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_DeleteSchemaRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_DeleteSchemaRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_CreateSchemaMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_CreateSchemaMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_UpdateSchemaMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_UpdateSchemaMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_DeleteSchemaMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_DeleteSchemaMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n9google/cloud/discoveryengine/v1alpha/s" + + "chema_service.proto\022$google.cloud.discov" + + "eryengine.v1alpha\032\034google/api/annotation" + + "s.proto\032\027google/api/client.proto\032\037google" + + "/api/field_behavior.proto\032\031google/api/re" + + "source.proto\0321google/cloud/discoveryengi" + + "ne/v1alpha/schema.proto\032#google/longrunn" + + "ing/operations.proto\032\033google/protobuf/em" + + "pty.proto\032\037google/protobuf/timestamp.pro" + + "to\"P\n\020GetSchemaRequest\022<\n\004name\030\001 \001(\tB.\342A" + + "\001\002\372A\'\n%discoveryengine.googleapis.com/Sc" + + "hema\"~\n\022ListSchemasRequest\022A\n\006parent\030\001 \001" + + "(\tB1\342A\001\002\372A*\n(discoveryengine.googleapis." + + "com/DataStore\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage" + + "_token\030\003 \001(\t\"m\n\023ListSchemasResponse\022=\n\007s" + + "chemas\030\001 \003(\0132,.google.cloud.discoveryeng" + + "ine.v1alpha.Schema\022\027\n\017next_page_token\030\002 " + + "\001(\t\"\265\001\n\023CreateSchemaRequest\022A\n\006parent\030\001 " + + "\001(\tB1\342A\001\002\372A*\n(discoveryengine.googleapis" + + ".com/DataStore\022B\n\006schema\030\002 \001(\0132,.google." + + "cloud.discoveryengine.v1alpha.SchemaB\004\342A" + + "\001\002\022\027\n\tschema_id\030\003 \001(\tB\004\342A\001\002\"p\n\023UpdateSch" + + "emaRequest\022B\n\006schema\030\001 \001(\0132,.google.clou" + + "d.discoveryengine.v1alpha.SchemaB\004\342A\001\002\022\025" + + "\n\rallow_missing\030\003 \001(\010\"S\n\023DeleteSchemaReq" + + "uest\022<\n\004name\030\001 \001(\tB.\342A\001\002\372A\'\n%discoveryen" + + "gine.googleapis.com/Schema\"x\n\024CreateSche" + + "maMetadata\022/\n\013create_time\030\001 \001(\0132\032.google" + + ".protobuf.Timestamp\022/\n\013update_time\030\002 \001(\013" + + "2\032.google.protobuf.Timestamp\"x\n\024UpdateSc" + + "hemaMetadata\022/\n\013create_time\030\001 \001(\0132\032.goog" + + "le.protobuf.Timestamp\022/\n\013update_time\030\002 \001" + + "(\0132\032.google.protobuf.Timestamp\"x\n\024Delete" + + "SchemaMetadata\022/\n\013create_time\030\001 \001(\0132\032.go" + + "ogle.protobuf.Timestamp\022/\n\013update_time\030\002" + + " \001(\0132\032.google.protobuf.Timestamp2\237\016\n\rSch" + + "emaService\022\220\002\n\tGetSchema\0226.google.cloud." + + "discoveryengine.v1alpha.GetSchemaRequest" + + "\032,.google.cloud.discoveryengine.v1alpha." + + "Schema\"\234\001\332A\004name\202\323\344\223\002\216\001\022=/v1alpha/{name=" + + "projects/*/locations/*/dataStores/*/sche" + + "mas/*}ZM\022K/v1alpha/{name=projects/*/loca" + + "tions/*/collections/*/dataStores/*/schem" + + "as/*}\022\243\002\n\013ListSchemas\0228.google.cloud.dis" + + "coveryengine.v1alpha.ListSchemasRequest\032" + + "9.google.cloud.discoveryengine.v1alpha.L" + + "istSchemasResponse\"\236\001\332A\006parent\202\323\344\223\002\216\001\022=/" + + "v1alpha/{parent=projects/*/locations/*/d" + + "ataStores/*}/schemasZM\022K/v1alpha/{parent" + + "=projects/*/locations/*/collections/*/da" + + "taStores/*}/schemas\022\225\003\n\014CreateSchema\0229.g" + + "oogle.cloud.discoveryengine.v1alpha.Crea" + + "teSchemaRequest\032\035.google.longrunning.Ope" + + "ration\"\252\002\312Ah\n+google.cloud.discoveryengi" + + "ne.v1alpha.Schema\0229google.cloud.discover" + + "yengine.v1alpha.CreateSchemaMetadata\332A\027p" + + "arent,schema,schema_id\202\323\344\223\002\236\001\"=/v1alpha/" + + "{parent=projects/*/locations/*/dataStore" + + "s/*}/schemas:\006schemaZU\"K/v1alpha/{parent" + + "=projects/*/locations/*/collections/*/da" + + "taStores/*}/schemas:\006schema\022\211\003\n\014UpdateSc" + + "hema\0229.google.cloud.discoveryengine.v1al" + + "pha.UpdateSchemaRequest\032\035.google.longrun" + + "ning.Operation\"\236\002\312Ah\n+google.cloud.disco" + + "veryengine.v1alpha.Schema\0229google.cloud." + + "discoveryengine.v1alpha.UpdateSchemaMeta" + + "data\202\323\344\223\002\254\0012D/v1alpha/{schema.name=proje" + + "cts/*/locations/*/dataStores/*/schemas/*" + + "}:\006schemaZ\\2R/v1alpha/{schema.name=proje" + + "cts/*/locations/*/collections/*/dataStor" + + "es/*/schemas/*}:\006schema\022\334\002\n\014DeleteSchema" + + "\0229.google.cloud.discoveryengine.v1alpha." + + "DeleteSchemaRequest\032\035.google.longrunning" + + ".Operation\"\361\001\312AR\n\025google.protobuf.Empty\022" + + "9google.cloud.discoveryengine.v1alpha.De" + + "leteSchemaMetadata\332A\004name\202\323\344\223\002\216\001*=/v1alp" + + "ha/{name=projects/*/locations/*/dataStor" + + "es/*/schemas/*}ZM*K/v1alpha/{name=projec" + + "ts/*/locations/*/collections/*/dataStore" + + "s/*/schemas/*}\032R\312A\036discoveryengine.googl" + + "eapis.com\322A.https://www.googleapis.com/a" + + "uth/cloud-platformB\236\002\n(com.google.cloud." + + "discoveryengine.v1alphaB\022SchemaServicePr" + + "otoP\001ZRcloud.google.com/go/discoveryengi" + + "ne/apiv1alpha/discoveryenginepb;discover" + + "yenginepb\242\002\017DISCOVERYENGINE\252\002$Google.Clo" + + "ud.DiscoveryEngine.V1Alpha\312\002$Google\\Clou" + + "d\\DiscoveryEngine\\V1alpha\352\002\'Google::Clou" + + "d::DiscoveryEngine::V1alphab\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.discoveryengine.v1alpha.SchemaProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_discoveryengine_v1alpha_GetSchemaRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_discoveryengine_v1alpha_GetSchemaRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_GetSchemaRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_discoveryengine_v1alpha_ListSchemasRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_discoveryengine_v1alpha_ListSchemasRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_ListSchemasRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_discoveryengine_v1alpha_ListSchemasResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_discoveryengine_v1alpha_ListSchemasResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_ListSchemasResponse_descriptor, + new java.lang.String[] { + "Schemas", "NextPageToken", + }); + internal_static_google_cloud_discoveryengine_v1alpha_CreateSchemaRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_discoveryengine_v1alpha_CreateSchemaRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_CreateSchemaRequest_descriptor, + new java.lang.String[] { + "Parent", "Schema", "SchemaId", + }); + internal_static_google_cloud_discoveryengine_v1alpha_UpdateSchemaRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_discoveryengine_v1alpha_UpdateSchemaRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_UpdateSchemaRequest_descriptor, + new java.lang.String[] { + "Schema", "AllowMissing", + }); + internal_static_google_cloud_discoveryengine_v1alpha_DeleteSchemaRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_discoveryengine_v1alpha_DeleteSchemaRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_DeleteSchemaRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_discoveryengine_v1alpha_CreateSchemaMetadata_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_discoveryengine_v1alpha_CreateSchemaMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_CreateSchemaMetadata_descriptor, + new java.lang.String[] { + "CreateTime", "UpdateTime", + }); + internal_static_google_cloud_discoveryengine_v1alpha_UpdateSchemaMetadata_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_discoveryengine_v1alpha_UpdateSchemaMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_UpdateSchemaMetadata_descriptor, + new java.lang.String[] { + "CreateTime", "UpdateTime", + }); + internal_static_google_cloud_discoveryengine_v1alpha_DeleteSchemaMetadata_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_discoveryengine_v1alpha_DeleteSchemaMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_DeleteSchemaMetadata_descriptor, + new java.lang.String[] { + "CreateTime", "UpdateTime", + }); + 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.discoveryengine.v1alpha.SchemaProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchInfo.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchInfo.java new file mode 100644 index 000000000000..6e62314e8e8a --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchInfo.java @@ -0,0 +1,1166 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/user_event.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Detailed search information.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchInfo} + */ +public final class SearchInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.SearchInfo) + SearchInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchInfo.newBuilder() to construct. + private SearchInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchInfo() { + searchQuery_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchInfo.class, + com.google.cloud.discoveryengine.v1alpha.SearchInfo.Builder.class); + } + + private int bitField0_; + public static final int SEARCH_QUERY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object searchQuery_ = ""; + /** + * + * + *
+   * The user's search query.
+   *
+   * See
+   * [SearchRequest.query][google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchInfo.search_query]
+   * or
+   * [PageInfo.page_category][google.cloud.discoveryengine.v1alpha.PageInfo.page_category]
+   * is required for `search` events. Other event types should not set this
+   * field. Otherwise, an `INVALID_ARGUMENT` error is returned.
+   * 
+ * + * string search_query = 1; + * + * @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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchInfo.search_query]
+   * or
+   * [PageInfo.page_category][google.cloud.discoveryengine.v1alpha.PageInfo.page_category]
+   * is required for `search` events. Other event types should not set this
+   * field. Otherwise, an `INVALID_ARGUMENT` error is returned.
+   * 
+ * + * string search_query = 1; + * + * @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 ORDER_BY_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * The order in which products are returned, if applicable.
+   *
+   * See
+   * [SearchRequest.order_by][google.cloud.discoveryengine.v1alpha.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 = 2; + * + * @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, if applicable.
+   *
+   * See
+   * [SearchRequest.order_by][google.cloud.discoveryengine.v1alpha.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 = 2; + * + * @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 = 3; + private int offset_ = 0; + /** + * + * + *
+   * 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.discoveryengine.v1alpha.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.
+   * 
+ * + * optional int32 offset = 3; + * + * @return Whether the offset field is set. + */ + @java.lang.Override + public boolean hasOffset() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * 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.discoveryengine.v1alpha.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.
+   * 
+ * + * optional int32 offset = 3; + * + * @return The offset. + */ + @java.lang.Override + public int getOffset() { + return offset_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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(searchQuery_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, searchQuery_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, orderBy_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(3, offset_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(searchQuery_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, searchQuery_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, orderBy_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, offset_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.SearchInfo)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchInfo other = + (com.google.cloud.discoveryengine.v1alpha.SearchInfo) obj; + + if (!getSearchQuery().equals(other.getSearchQuery())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (hasOffset() != other.hasOffset()) return false; + if (hasOffset()) { + if (getOffset() != other.getOffset()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SEARCH_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getSearchQuery().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + if (hasOffset()) { + hash = (37 * hash) + OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getOffset(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.discoveryengine.v1alpha.SearchInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 search information.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchInfo) + com.google.cloud.discoveryengine.v1alpha.SearchInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchInfo.class, + com.google.cloud.discoveryengine.v1alpha.SearchInfo.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.SearchInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + searchQuery_ = ""; + orderBy_ = ""; + offset_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchInfo getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchInfo build() { + com.google.cloud.discoveryengine.v1alpha.SearchInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchInfo buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchInfo result = + new com.google.cloud.discoveryengine.v1alpha.SearchInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.SearchInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.searchQuery_ = searchQuery_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.orderBy_ = orderBy_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.offset_ = offset_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.SearchInfo) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.SearchInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.SearchInfo other) { + if (other == com.google.cloud.discoveryengine.v1alpha.SearchInfo.getDefaultInstance()) + return this; + if (!other.getSearchQuery().isEmpty()) { + searchQuery_ = other.searchQuery_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasOffset()) { + setOffset(other.getOffset()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + searchQuery_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + offset_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object searchQuery_ = ""; + /** + * + * + *
+     * The user's search query.
+     *
+     * See
+     * [SearchRequest.query][google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchInfo.search_query]
+     * or
+     * [PageInfo.page_category][google.cloud.discoveryengine.v1alpha.PageInfo.page_category]
+     * is required for `search` events. Other event types should not set this
+     * field. Otherwise, an `INVALID_ARGUMENT` error is returned.
+     * 
+ * + * string search_query = 1; + * + * @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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchInfo.search_query]
+     * or
+     * [PageInfo.page_category][google.cloud.discoveryengine.v1alpha.PageInfo.page_category]
+     * is required for `search` events. Other event types should not set this
+     * field. Otherwise, an `INVALID_ARGUMENT` error is returned.
+     * 
+ * + * string search_query = 1; + * + * @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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchInfo.search_query]
+     * or
+     * [PageInfo.page_category][google.cloud.discoveryengine.v1alpha.PageInfo.page_category]
+     * is required for `search` events. Other event types should not set this
+     * field. Otherwise, an `INVALID_ARGUMENT` error is returned.
+     * 
+ * + * string search_query = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The user's search query.
+     *
+     * See
+     * [SearchRequest.query][google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchInfo.search_query]
+     * or
+     * [PageInfo.page_category][google.cloud.discoveryengine.v1alpha.PageInfo.page_category]
+     * is required for `search` events. Other event types should not set this
+     * field. Otherwise, an `INVALID_ARGUMENT` error is returned.
+     * 
+ * + * string search_query = 1; + * + * @return This builder for chaining. + */ + public Builder clearSearchQuery() { + searchQuery_ = getDefaultInstance().getSearchQuery(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The user's search query.
+     *
+     * See
+     * [SearchRequest.query][google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchInfo.search_query]
+     * or
+     * [PageInfo.page_category][google.cloud.discoveryengine.v1alpha.PageInfo.page_category]
+     * is required for `search` events. Other event types should not set this
+     * field. Otherwise, an `INVALID_ARGUMENT` error is returned.
+     * 
+ * + * string search_query = 1; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * The order in which products are returned, if applicable.
+     *
+     * See
+     * [SearchRequest.order_by][google.cloud.discoveryengine.v1alpha.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 = 2; + * + * @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, if applicable.
+     *
+     * See
+     * [SearchRequest.order_by][google.cloud.discoveryengine.v1alpha.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 = 2; + * + * @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, if applicable.
+     *
+     * See
+     * [SearchRequest.order_by][google.cloud.discoveryengine.v1alpha.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 = 2; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The order in which products are returned, if applicable.
+     *
+     * See
+     * [SearchRequest.order_by][google.cloud.discoveryengine.v1alpha.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 = 2; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The order in which products are returned, if applicable.
+     *
+     * See
+     * [SearchRequest.order_by][google.cloud.discoveryengine.v1alpha.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 = 2; + * + * @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; + bitField0_ |= 0x00000002; + 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.discoveryengine.v1alpha.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.
+     * 
+ * + * optional int32 offset = 3; + * + * @return Whether the offset field is set. + */ + @java.lang.Override + public boolean hasOffset() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * 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.discoveryengine.v1alpha.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.
+     * 
+ * + * optional int32 offset = 3; + * + * @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.discoveryengine.v1alpha.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.
+     * 
+ * + * optional int32 offset = 3; + * + * @param value The offset to set. + * @return This builder for chaining. + */ + public Builder setOffset(int value) { + + offset_ = value; + bitField0_ |= 0x00000004; + 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.discoveryengine.v1alpha.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.
+     * 
+ * + * optional int32 offset = 3; + * + * @return This builder for chaining. + */ + public Builder clearOffset() { + bitField0_ = (bitField0_ & ~0x00000004); + offset_ = 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.discoveryengine.v1alpha.SearchInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchInfo) + private static final com.google.cloud.discoveryengine.v1alpha.SearchInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.SearchInfo(); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchInfoOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchInfoOrBuilder.java new file mode 100644 index 000000000000..9f3dfee5bbd7 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchInfoOrBuilder.java @@ -0,0 +1,168 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/user_event.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface SearchInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The user's search query.
+   *
+   * See
+   * [SearchRequest.query][google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchInfo.search_query]
+   * or
+   * [PageInfo.page_category][google.cloud.discoveryengine.v1alpha.PageInfo.page_category]
+   * is required for `search` events. Other event types should not set this
+   * field. Otherwise, an `INVALID_ARGUMENT` error is returned.
+   * 
+ * + * string search_query = 1; + * + * @return The searchQuery. + */ + java.lang.String getSearchQuery(); + /** + * + * + *
+   * The user's search query.
+   *
+   * See
+   * [SearchRequest.query][google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchInfo.search_query]
+   * or
+   * [PageInfo.page_category][google.cloud.discoveryengine.v1alpha.PageInfo.page_category]
+   * is required for `search` events. Other event types should not set this
+   * field. Otherwise, an `INVALID_ARGUMENT` error is returned.
+   * 
+ * + * string search_query = 1; + * + * @return The bytes for searchQuery. + */ + com.google.protobuf.ByteString getSearchQueryBytes(); + + /** + * + * + *
+   * The order in which products are returned, if applicable.
+   *
+   * See
+   * [SearchRequest.order_by][google.cloud.discoveryengine.v1alpha.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 = 2; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * The order in which products are returned, if applicable.
+   *
+   * See
+   * [SearchRequest.order_by][google.cloud.discoveryengine.v1alpha.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 = 2; + * + * @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.discoveryengine.v1alpha.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.
+   * 
+ * + * optional int32 offset = 3; + * + * @return Whether the offset field is set. + */ + boolean hasOffset(); + /** + * + * + *
+   * 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.discoveryengine.v1alpha.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.
+   * 
+ * + * optional int32 offset = 3; + * + * @return The offset. + */ + int getOffset(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchRequest.java new file mode 100644 index 000000000000..cf35f4dace73 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchRequest.java @@ -0,0 +1,23202 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/search_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request message for
+ * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchRequest} + */ +public final class SearchRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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() { + servingConfig_ = ""; + branch_ = ""; + query_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + facetSpecs_ = java.util.Collections.emptyList(); + userPseudoId_ = ""; + rankingExpression_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 11: + return internalGetParams(); + case 22: + return internalGetUserLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.Builder.class); + } + + public interface ImageQueryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+     * BMP.
+     * 
+ * + * string image_bytes = 1; + * + * @return Whether the imageBytes field is set. + */ + boolean hasImageBytes(); + /** + * + * + *
+     * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+     * BMP.
+     * 
+ * + * string image_bytes = 1; + * + * @return The imageBytes. + */ + java.lang.String getImageBytes(); + /** + * + * + *
+     * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+     * BMP.
+     * 
+ * + * string image_bytes = 1; + * + * @return The bytes for imageBytes. + */ + com.google.protobuf.ByteString getImageBytesBytes(); + + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery.ImageCase getImageCase(); + } + /** + * + * + *
+   * Specifies the image query input.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery} + */ + public static final class ImageQuery extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery) + ImageQueryOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImageQuery.newBuilder() to construct. + private ImageQuery(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImageQuery() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImageQuery(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ImageQuery_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ImageQuery_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery.Builder.class); + } + + private int imageCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object image_; + + public enum ImageCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + IMAGE_BYTES(1), + IMAGE_NOT_SET(0); + private final int value; + + private ImageCase(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 ImageCase valueOf(int value) { + return forNumber(value); + } + + public static ImageCase forNumber(int value) { + switch (value) { + case 1: + return IMAGE_BYTES; + case 0: + return IMAGE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ImageCase getImageCase() { + return ImageCase.forNumber(imageCase_); + } + + public static final int IMAGE_BYTES_FIELD_NUMBER = 1; + /** + * + * + *
+     * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+     * BMP.
+     * 
+ * + * string image_bytes = 1; + * + * @return Whether the imageBytes field is set. + */ + public boolean hasImageBytes() { + return imageCase_ == 1; + } + /** + * + * + *
+     * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+     * BMP.
+     * 
+ * + * string image_bytes = 1; + * + * @return The imageBytes. + */ + public java.lang.String getImageBytes() { + java.lang.Object ref = ""; + if (imageCase_ == 1) { + ref = image_; + } + if (ref instanceof java.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 (imageCase_ == 1) { + image_ = s; + } + return s; + } + } + /** + * + * + *
+     * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+     * BMP.
+     * 
+ * + * string image_bytes = 1; + * + * @return The bytes for imageBytes. + */ + public com.google.protobuf.ByteString getImageBytesBytes() { + java.lang.Object ref = ""; + if (imageCase_ == 1) { + ref = image_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (imageCase_ == 1) { + image_ = 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 (imageCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, image_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (imageCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, image_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery other = + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery) obj; + + if (!getImageCase().equals(other.getImageCase())) return false; + switch (imageCase_) { + case 1: + if (!getImageBytes().equals(other.getImageBytes())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (imageCase_) { + case 1: + hash = (37 * hash) + IMAGE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getImageBytes().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 the image query input.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery) + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQueryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ImageQuery_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ImageQuery_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + imageCase_ = 0; + image_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ImageQuery_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery build() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery result = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery result) { + result.imageCase_ = imageCase_; + result.image_ = this.image_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery + .getDefaultInstance()) return this; + switch (other.getImageCase()) { + case IMAGE_BYTES: + { + imageCase_ = 1; + image_ = other.image_; + onChanged(); + break; + } + case IMAGE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + imageCase_ = 1; + image_ = s; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int imageCase_ = 0; + private java.lang.Object image_; + + public ImageCase getImageCase() { + return ImageCase.forNumber(imageCase_); + } + + public Builder clearImage() { + imageCase_ = 0; + image_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+       * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+       * BMP.
+       * 
+ * + * string image_bytes = 1; + * + * @return Whether the imageBytes field is set. + */ + @java.lang.Override + public boolean hasImageBytes() { + return imageCase_ == 1; + } + /** + * + * + *
+       * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+       * BMP.
+       * 
+ * + * string image_bytes = 1; + * + * @return The imageBytes. + */ + @java.lang.Override + public java.lang.String getImageBytes() { + java.lang.Object ref = ""; + if (imageCase_ == 1) { + ref = image_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (imageCase_ == 1) { + image_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+       * BMP.
+       * 
+ * + * string image_bytes = 1; + * + * @return The bytes for imageBytes. + */ + @java.lang.Override + public com.google.protobuf.ByteString getImageBytesBytes() { + java.lang.Object ref = ""; + if (imageCase_ == 1) { + ref = image_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (imageCase_ == 1) { + image_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+       * BMP.
+       * 
+ * + * string image_bytes = 1; + * + * @param value The imageBytes to set. + * @return This builder for chaining. + */ + public Builder setImageBytes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + imageCase_ = 1; + image_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+       * BMP.
+       * 
+ * + * string image_bytes = 1; + * + * @return This builder for chaining. + */ + public Builder clearImageBytes() { + if (imageCase_ == 1) { + imageCase_ = 0; + image_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
+       * BMP.
+       * 
+ * + * string image_bytes = 1; + * + * @param value The bytes for imageBytes to set. + * @return This builder for chaining. + */ + public Builder setImageBytesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + imageCase_ = 1; + image_ = 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.discoveryengine.v1alpha.SearchRequest.ImageQuery) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery) + private static final com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery(); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImageQuery parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface FacetSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The facetKey. + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey getFacetKey(); + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.discoveryengine.v1alpha.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 are 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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     *
+     * Listing a facet key in this field allows its values to appear as facet
+     * results, even when they are filtered out of search results. Using this
+     * field does not affect what search results are returned.
+     *
+     * For example, suppose there are 100 documents with the color facet "Red"
+     * and 200 documents with the color facet "Blue". A query containing the
+     * filter "color:ANY("Red")" and having "color" as
+     * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * would by default return only "Red" documents in the search results, and
+     * also return "Red" with count 100 as the only color facet. Although there
+     * are also blue documents available, "Blue" would not be shown as an
+     * available facet value.
+     *
+     * If "color" is listed in "excludedFilterKeys", then the query returns the
+     * facet values "Red" with count 100 and "Blue" with count 200, because the
+     * "color" key is now excluded from the filter. Because this field doesn't
+     * affect search results, the search results are still correctly filtered to
+     * return only "Red" documents.
+     *
+     * 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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     *
+     * Listing a facet key in this field allows its values to appear as facet
+     * results, even when they are filtered out of search results. Using this
+     * field does not affect what search results are returned.
+     *
+     * For example, suppose there are 100 documents with the color facet "Red"
+     * and 200 documents with the color facet "Blue". A query containing the
+     * filter "color:ANY("Red")" and having "color" as
+     * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * would by default return only "Red" documents in the search results, and
+     * also return "Red" with count 100 as the only color facet. Although there
+     * are also blue documents available, "Blue" would not be shown as an
+     * available facet value.
+     *
+     * If "color" is listed in "excludedFilterKeys", then the query returns the
+     * facet values "Red" with count 100 and "Blue" with count 200, because the
+     * "color" key is now excluded from the filter. Because this field doesn't
+     * affect search results, the search results are still correctly filtered to
+     * return only "Red" documents.
+     *
+     * 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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     *
+     * Listing a facet key in this field allows its values to appear as facet
+     * results, even when they are filtered out of search results. Using this
+     * field does not affect what search results are returned.
+     *
+     * For example, suppose there are 100 documents with the color facet "Red"
+     * and 200 documents with the color facet "Blue". A query containing the
+     * filter "color:ANY("Red")" and having "color" as
+     * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * would by default return only "Red" documents in the search results, and
+     * also return "Red" with count 100 as the only color facet. Although there
+     * are also blue documents available, "Blue" would not be shown as an
+     * available facet value.
+     *
+     * If "color" is listed in "excludedFilterKeys", then the query returns the
+     * facet values "Red" with count 100 and "Blue" with count 200, because the
+     * "color" key is now excluded from the filter. Because this field doesn't
+     * affect search results, the search results are still correctly filtered to
+     * return only "Red" documents.
+     *
+     * 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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     *
+     * Listing a facet key in this field allows its values to appear as facet
+     * results, even when they are filtered out of search results. Using this
+     * field does not affect what search results are returned.
+     *
+     * For example, suppose there are 100 documents with the color facet "Red"
+     * and 200 documents with the color facet "Blue". A query containing the
+     * filter "color:ANY("Red")" and having "color" as
+     * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * would by default return only "Red" documents in the search results, and
+     * also return "Red" with count 100 as the only color facet. Although there
+     * are also blue documents available, "Blue" would not be shown as an
+     * available facet value.
+     *
+     * If "color" is listed in "excludedFilterKeys", then the query returns the
+     * facet values "Red" with count 100 and "Blue" with count 200, because the
+     * "color" key is now excluded from the filter. Because this field doesn't
+     * affect search results, the search results are still correctly filtered to
+     * return only "Red" documents.
+     *
+     * 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 automatically.
+     * If dynamic facets are enabled, it is ordered together.
+     * If set to false, the position of this facet in the
+     * response is the same as in the request, and it is 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 is determined
+     * automatically.
+     *
+     * 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 enabled, which generates 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 API orders "gender" and "rating" facets.
+     * However, notice that "price" and "brands" are always
+     * ranked at first and second position because their enable_dynamic_position
+     * is false.
+     * 
+ * + * bool enable_dynamic_position = 4; + * + * @return The enableDynamicPosition. + */ + boolean getEnableDynamicPosition(); + } + /** + * + * + *
+   * A facet specification to perform faceted search.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec} + */ + public static final class FacetSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FacetSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_FacetSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_FacetSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.Builder.class); + } + + public interface FacetKeyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Required. Supported textual and numerical facet keys in
+       * [Document][google.cloud.discoveryengine.v1alpha.Document] object, over
+       * which the facet values are computed. Facet key is case-sensitive.
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+       * Required. Supported textual and numerical facet keys in
+       * [Document][google.cloud.discoveryengine.v1alpha.Document] object, over
+       * which the facet values are computed. Facet key is case-sensitive.
+       * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
+       * Set only if values should be bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + java.util.List getIntervalsList(); + /** + * + * + *
+       * Set only if values should be bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + com.google.cloud.discoveryengine.v1alpha.Interval getIntervals(int index); + /** + * + * + *
+       * Set only if values should be bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + int getIntervalsCount(); + /** + * + * + *
+       * Set only if values should be bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + java.util.List + getIntervalsOrBuilderList(); + /** + * + * + *
+       * Set only if values should be bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + com.google.cloud.discoveryengine.v1alpha.IntervalOrBuilder getIntervalsOrBuilder(int index); + + /** + * + * + *
+       * Only get facet for the given restricted values. Only supported on
+       * textual fields. For example, suppose "category" has three values
+       * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+       * "restricted_values" to "Action > 2022", the "category" facet only
+       * contains "Action > 2022". Only supported on textual fields. Maximum
+       * is 10.
+       * 
+ * + * repeated string restricted_values = 3; + * + * @return A list containing the restrictedValues. + */ + java.util.List getRestrictedValuesList(); + /** + * + * + *
+       * Only get facet for the given restricted values. Only supported on
+       * textual fields. For example, suppose "category" has three values
+       * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+       * "restricted_values" to "Action > 2022", the "category" facet only
+       * contains "Action > 2022". Only supported on textual fields. Maximum
+       * is 10.
+       * 
+ * + * repeated string restricted_values = 3; + * + * @return The count of restrictedValues. + */ + int getRestrictedValuesCount(); + /** + * + * + *
+       * Only get facet for the given restricted values. Only supported on
+       * textual fields. For example, suppose "category" has three values
+       * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+       * "restricted_values" to "Action > 2022", the "category" facet only
+       * contains "Action > 2022". Only supported on textual fields. Maximum
+       * is 10.
+       * 
+ * + * 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. Only supported on
+       * textual fields. For example, suppose "category" has three values
+       * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+       * "restricted_values" to "Action > 2022", the "category" facet only
+       * contains "Action > 2022". Only supported on textual fields. Maximum
+       * is 10.
+       * 
+ * + * 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 "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+       * "category" facet only contains "Action > 2022" and "Action > 2021".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 4; + * + * @return A list containing the prefixes. + */ + java.util.List getPrefixesList(); + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+       * "category" facet only contains "Action > 2022" and "Action > 2021".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 4; + * + * @return The count of prefixes. + */ + int getPrefixesCount(); + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+       * "category" facet only contains "Action > 2022" and "Action > 2021".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 4; + * + * @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 "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+       * "category" facet only contains "Action > 2022" and "Action > 2021".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 4; + * + * @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 "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+       * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 5; + * + * @return A list containing the contains. + */ + java.util.List getContainsList(); + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+       * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 5; + * + * @return The count of contains. + */ + int getContainsCount(); + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+       * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 5; + * + * @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 "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+       * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 5; + * + * @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); + + /** + * + * + *
+       * True to make facet keys case insensitive when getting faceting
+       * values with prefixes or contains; false otherwise.
+       * 
+ * + * bool case_insensitive = 6; + * + * @return The caseInsensitive. + */ + boolean getCaseInsensitive(); + + /** + * + * + *
+       * The order in which documents are returned.
+       *
+       * Allowed values are:
+       *
+       * * "count desc", which means order by
+       * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.count]
+       * descending.
+       *
+       * * "value desc", which means order by
+       * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1alpha.SearchResponse.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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+       * 
+ * + * string order_by = 7; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+       * The order in which documents are returned.
+       *
+       * Allowed values are:
+       *
+       * * "count desc", which means order by
+       * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.count]
+       * descending.
+       *
+       * * "value desc", which means order by
+       * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1alpha.SearchResponse.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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+       * 
+ * + * string order_by = 7; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); + } + /** + * + * + *
+     * Specifies how a facet is computed.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey} + */ + public static final class FacetKey extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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.emptyList(); + prefixes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + contains_ = com.google.protobuf.LazyStringArrayList.emptyList(); + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FacetKey(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_FacetSpec_FacetKey_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_FacetSpec_FacetKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.Builder + .class); + } + + public static final int KEY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object key_ = ""; + /** + * + * + *
+       * Required. Supported textual and numerical facet keys in
+       * [Document][google.cloud.discoveryengine.v1alpha.Document] object, over
+       * which the facet values are computed. Facet key is case-sensitive.
+       * 
+ * + * 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
+       * [Document][google.cloud.discoveryengine.v1alpha.Document] object, over
+       * which the facet values are computed. Facet key is case-sensitive.
+       * 
+ * + * 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; + + @SuppressWarnings("serial") + private java.util.List intervals_; + /** + * + * + *
+       * Set only if values should be bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + @java.lang.Override + public java.util.List getIntervalsList() { + return intervals_; + } + /** + * + * + *
+       * Set only if values should be bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + @java.lang.Override + public java.util.List + getIntervalsOrBuilderList() { + return intervals_; + } + /** + * + * + *
+       * Set only if values should be bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + @java.lang.Override + public int getIntervalsCount() { + return intervals_.size(); + } + /** + * + * + *
+       * Set only if values should be bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Interval getIntervals(int index) { + return intervals_.get(index); + } + /** + * + * + *
+       * Set only if values should be bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.IntervalOrBuilder getIntervalsOrBuilder( + int index) { + return intervals_.get(index); + } + + public static final int RESTRICTED_VALUES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList restrictedValues_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+       * Only get facet for the given restricted values. Only supported on
+       * textual fields. For example, suppose "category" has three values
+       * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+       * "restricted_values" to "Action > 2022", the "category" facet only
+       * contains "Action > 2022". Only supported on textual fields. Maximum
+       * is 10.
+       * 
+ * + * 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. Only supported on
+       * textual fields. For example, suppose "category" has three values
+       * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+       * "restricted_values" to "Action > 2022", the "category" facet only
+       * contains "Action > 2022". Only supported on textual fields. Maximum
+       * is 10.
+       * 
+ * + * repeated string restricted_values = 3; + * + * @return The count of restrictedValues. + */ + public int getRestrictedValuesCount() { + return restrictedValues_.size(); + } + /** + * + * + *
+       * Only get facet for the given restricted values. Only supported on
+       * textual fields. For example, suppose "category" has three values
+       * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+       * "restricted_values" to "Action > 2022", the "category" facet only
+       * contains "Action > 2022". Only supported on textual fields. Maximum
+       * is 10.
+       * 
+ * + * 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. Only supported on
+       * textual fields. For example, suppose "category" has three values
+       * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+       * "restricted_values" to "Action > 2022", the "category" facet only
+       * contains "Action > 2022". Only supported on textual fields. Maximum
+       * is 10.
+       * 
+ * + * 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 = 4; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList prefixes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+       * Only get facet values that start with the given string prefix. For
+       * example, suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+       * "category" facet only contains "Action > 2022" and "Action > 2021".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 4; + * + * @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 "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+       * "category" facet only contains "Action > 2022" and "Action > 2021".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 4; + * + * @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 "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+       * "category" facet only contains "Action > 2022" and "Action > 2021".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 4; + * + * @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 "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+       * "category" facet only contains "Action > 2022" and "Action > 2021".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string prefixes = 4; + * + * @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 = 5; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList contains_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+       * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 5; + * + * @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 "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+       * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 5; + * + * @return The count of contains. + */ + public int getContainsCount() { + return contains_.size(); + } + /** + * + * + *
+       * Only get facet values that contains the given strings. For example,
+       * suppose "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+       * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 5; + * + * @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 "category" has three values "Action > 2022",
+       * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+       * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+       * Only supported on textual fields. Maximum is 10.
+       * 
+ * + * repeated string contains = 5; + * + * @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 CASE_INSENSITIVE_FIELD_NUMBER = 6; + private boolean caseInsensitive_ = false; + /** + * + * + *
+       * True to make facet keys case insensitive when getting faceting
+       * values with prefixes or contains; false otherwise.
+       * 
+ * + * bool case_insensitive = 6; + * + * @return The caseInsensitive. + */ + @java.lang.Override + public boolean getCaseInsensitive() { + return caseInsensitive_; + } + + public static final int ORDER_BY_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+       * The order in which documents are returned.
+       *
+       * Allowed values are:
+       *
+       * * "count desc", which means order by
+       * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.count]
+       * descending.
+       *
+       * * "value desc", which means order by
+       * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1alpha.SearchResponse.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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+       * 
+ * + * string order_by = 7; + * + * @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 documents are returned.
+       *
+       * Allowed values are:
+       *
+       * * "count desc", which means order by
+       * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.count]
+       * descending.
+       *
+       * * "value desc", which means order by
+       * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1alpha.SearchResponse.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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+       * 
+ * + * string order_by = 7; + * + * @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; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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)); + } + for (int i = 0; i < prefixes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, prefixes_.getRaw(i)); + } + for (int i = 0; i < contains_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, contains_.getRaw(i)); + } + if (caseInsensitive_ != false) { + output.writeBool(6, caseInsensitive_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, orderBy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(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(); + } + { + 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(); + } + if (caseInsensitive_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, caseInsensitive_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, orderBy_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey other = + (com.google.cloud.discoveryengine.v1alpha.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 (getCaseInsensitive() != other.getCaseInsensitive()) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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) + CASE_INSENSITIVE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCaseInsensitive()); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey) + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKeyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_FacetSpec_FacetKey_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_FacetSpec_FacetKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.Builder + .class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + key_ = ""; + if (intervalsBuilder_ == null) { + intervals_ = java.util.Collections.emptyList(); + } else { + intervals_ = null; + intervalsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + restrictedValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + prefixes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + contains_ = com.google.protobuf.LazyStringArrayList.emptyList(); + caseInsensitive_ = false; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_FacetSpec_FacetKey_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey build() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey + buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey result = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey result) { + if (intervalsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + intervals_ = java.util.Collections.unmodifiableList(intervals_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.intervals_ = intervals_; + } else { + result.intervals_ = intervalsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + restrictedValues_.makeImmutable(); + result.restrictedValues_ = restrictedValues_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + prefixes_.makeImmutable(); + result.prefixes_ = prefixes_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + contains_.makeImmutable(); + result.contains_ = contains_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.caseInsensitive_ = caseInsensitive_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey + .getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (intervalsBuilder_ == null) { + if (!other.intervals_.isEmpty()) { + if (intervals_.isEmpty()) { + intervals_ = other.intervals_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureIntervalsIsMutable(); + intervals_.addAll(other.intervals_); + } + onChanged(); + } + } else { + if (!other.intervals_.isEmpty()) { + if (intervalsBuilder_.isEmpty()) { + intervalsBuilder_.dispose(); + intervalsBuilder_ = null; + intervals_ = other.intervals_; + bitField0_ = (bitField0_ & ~0x00000002); + intervalsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getIntervalsFieldBuilder() + : null; + } else { + intervalsBuilder_.addAllMessages(other.intervals_); + } + } + } + if (!other.restrictedValues_.isEmpty()) { + if (restrictedValues_.isEmpty()) { + restrictedValues_ = other.restrictedValues_; + bitField0_ |= 0x00000004; + } else { + ensureRestrictedValuesIsMutable(); + restrictedValues_.addAll(other.restrictedValues_); + } + onChanged(); + } + if (!other.prefixes_.isEmpty()) { + if (prefixes_.isEmpty()) { + prefixes_ = other.prefixes_; + bitField0_ |= 0x00000008; + } else { + ensurePrefixesIsMutable(); + prefixes_.addAll(other.prefixes_); + } + onChanged(); + } + if (!other.contains_.isEmpty()) { + if (contains_.isEmpty()) { + contains_ = other.contains_; + bitField0_ |= 0x00000010; + } else { + ensureContainsIsMutable(); + contains_.addAll(other.contains_); + } + onChanged(); + } + if (other.getCaseInsensitive() != false) { + setCaseInsensitive(other.getCaseInsensitive()); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000040; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + key_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.discoveryengine.v1alpha.Interval m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.Interval.parser(), + extensionRegistry); + if (intervalsBuilder_ == null) { + ensureIntervalsIsMutable(); + intervals_.add(m); + } else { + intervalsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureRestrictedValuesIsMutable(); + restrictedValues_.add(s); + break; + } // case 26 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensurePrefixesIsMutable(); + prefixes_.add(s); + break; + } // case 34 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureContainsIsMutable(); + contains_.add(s); + break; + } // case 42 + case 48: + { + caseInsensitive_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * + * + *
+         * Required. Supported textual and numerical facet keys in
+         * [Document][google.cloud.discoveryengine.v1alpha.Document] object, over
+         * which the facet values are computed. Facet key is case-sensitive.
+         * 
+ * + * 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
+         * [Document][google.cloud.discoveryengine.v1alpha.Document] object, over
+         * which the facet values are computed. Facet key is case-sensitive.
+         * 
+ * + * 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
+         * [Document][google.cloud.discoveryengine.v1alpha.Document] object, over
+         * which the facet values are computed. Facet key is case-sensitive.
+         * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * Required. Supported textual and numerical facet keys in
+         * [Document][google.cloud.discoveryengine.v1alpha.Document] object, over
+         * which the facet values are computed. Facet key is case-sensitive.
+         * 
+ * + * string key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + key_ = getDefaultInstance().getKey(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+         * Required. Supported textual and numerical facet keys in
+         * [Document][google.cloud.discoveryengine.v1alpha.Document] object, over
+         * which the facet values are computed. Facet key is case-sensitive.
+         * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List intervals_ = + java.util.Collections.emptyList(); + + private void ensureIntervalsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + intervals_ = + new java.util.ArrayList( + intervals_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Interval, + com.google.cloud.discoveryengine.v1alpha.Interval.Builder, + com.google.cloud.discoveryengine.v1alpha.IntervalOrBuilder> + intervalsBuilder_; + + /** + * + * + *
+         * Set only if values should be bucketed 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.discoveryengine.v1alpha.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 bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + public int getIntervalsCount() { + if (intervalsBuilder_ == null) { + return intervals_.size(); + } else { + return intervalsBuilder_.getCount(); + } + } + /** + * + * + *
+         * Set only if values should be bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.Interval getIntervals(int index) { + if (intervalsBuilder_ == null) { + return intervals_.get(index); + } else { + return intervalsBuilder_.getMessage(index); + } + } + /** + * + * + *
+         * Set only if values should be bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + public Builder setIntervals( + int index, com.google.cloud.discoveryengine.v1alpha.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 bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + public Builder setIntervals( + int index, com.google.cloud.discoveryengine.v1alpha.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 bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + public Builder addIntervals(com.google.cloud.discoveryengine.v1alpha.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 bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + public Builder addIntervals( + int index, com.google.cloud.discoveryengine.v1alpha.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 bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + public Builder addIntervals( + com.google.cloud.discoveryengine.v1alpha.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 bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + public Builder addIntervals( + int index, com.google.cloud.discoveryengine.v1alpha.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 bucketed 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.discoveryengine.v1alpha.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 bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + public Builder clearIntervals() { + if (intervalsBuilder_ == null) { + intervals_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + intervalsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+         * Set only if values should be bucketed 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.discoveryengine.v1alpha.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 bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.Interval.Builder getIntervalsBuilder( + int index) { + return getIntervalsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+         * Set only if values should be bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.IntervalOrBuilder getIntervalsOrBuilder( + int index) { + if (intervalsBuilder_ == null) { + return intervals_.get(index); + } else { + return intervalsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+         * Set only if values should be bucketed 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.discoveryengine.v1alpha.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 bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.Interval.Builder addIntervalsBuilder() { + return getIntervalsFieldBuilder() + .addBuilder(com.google.cloud.discoveryengine.v1alpha.Interval.getDefaultInstance()); + } + /** + * + * + *
+         * Set only if values should be bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.Interval.Builder addIntervalsBuilder( + int index) { + return getIntervalsFieldBuilder() + .addBuilder( + index, com.google.cloud.discoveryengine.v1alpha.Interval.getDefaultInstance()); + } + /** + * + * + *
+         * Set only if values should be bucketed 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.discoveryengine.v1alpha.Interval intervals = 2; + */ + public java.util.List + getIntervalsBuilderList() { + return getIntervalsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Interval, + com.google.cloud.discoveryengine.v1alpha.Interval.Builder, + com.google.cloud.discoveryengine.v1alpha.IntervalOrBuilder> + getIntervalsFieldBuilder() { + if (intervalsBuilder_ == null) { + intervalsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Interval, + com.google.cloud.discoveryengine.v1alpha.Interval.Builder, + com.google.cloud.discoveryengine.v1alpha.IntervalOrBuilder>( + intervals_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + intervals_ = null; + } + return intervalsBuilder_; + } + + private com.google.protobuf.LazyStringArrayList restrictedValues_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureRestrictedValuesIsMutable() { + if (!restrictedValues_.isModifiable()) { + restrictedValues_ = new com.google.protobuf.LazyStringArrayList(restrictedValues_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+         * Only get facet for the given restricted values. Only supported on
+         * textual fields. For example, suppose "category" has three values
+         * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+         * "restricted_values" to "Action > 2022", the "category" facet only
+         * contains "Action > 2022". Only supported on textual fields. Maximum
+         * is 10.
+         * 
+ * + * repeated string restricted_values = 3; + * + * @return A list containing the restrictedValues. + */ + public com.google.protobuf.ProtocolStringList getRestrictedValuesList() { + restrictedValues_.makeImmutable(); + return restrictedValues_; + } + /** + * + * + *
+         * Only get facet for the given restricted values. Only supported on
+         * textual fields. For example, suppose "category" has three values
+         * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+         * "restricted_values" to "Action > 2022", the "category" facet only
+         * contains "Action > 2022". Only supported on textual fields. Maximum
+         * is 10.
+         * 
+ * + * repeated string restricted_values = 3; + * + * @return The count of restrictedValues. + */ + public int getRestrictedValuesCount() { + return restrictedValues_.size(); + } + /** + * + * + *
+         * Only get facet for the given restricted values. Only supported on
+         * textual fields. For example, suppose "category" has three values
+         * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+         * "restricted_values" to "Action > 2022", the "category" facet only
+         * contains "Action > 2022". Only supported on textual fields. Maximum
+         * is 10.
+         * 
+ * + * 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. Only supported on
+         * textual fields. For example, suppose "category" has three values
+         * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+         * "restricted_values" to "Action > 2022", the "category" facet only
+         * contains "Action > 2022". Only supported on textual fields. Maximum
+         * is 10.
+         * 
+ * + * 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. Only supported on
+         * textual fields. For example, suppose "category" has three values
+         * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+         * "restricted_values" to "Action > 2022", the "category" facet only
+         * contains "Action > 2022". Only supported on textual fields. Maximum
+         * is 10.
+         * 
+ * + * 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); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet for the given restricted values. Only supported on
+         * textual fields. For example, suppose "category" has three values
+         * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+         * "restricted_values" to "Action > 2022", the "category" facet only
+         * contains "Action > 2022". Only supported on textual fields. Maximum
+         * is 10.
+         * 
+ * + * 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); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet for the given restricted values. Only supported on
+         * textual fields. For example, suppose "category" has three values
+         * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+         * "restricted_values" to "Action > 2022", the "category" facet only
+         * contains "Action > 2022". Only supported on textual fields. Maximum
+         * is 10.
+         * 
+ * + * 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_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet for the given restricted values. Only supported on
+         * textual fields. For example, suppose "category" has three values
+         * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+         * "restricted_values" to "Action > 2022", the "category" facet only
+         * contains "Action > 2022". Only supported on textual fields. Maximum
+         * is 10.
+         * 
+ * + * repeated string restricted_values = 3; + * + * @return This builder for chaining. + */ + public Builder clearRestrictedValues() { + restrictedValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet for the given restricted values. Only supported on
+         * textual fields. For example, suppose "category" has three values
+         * "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
+         * "restricted_values" to "Action > 2022", the "category" facet only
+         * contains "Action > 2022". Only supported on textual fields. Maximum
+         * is 10.
+         * 
+ * + * 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); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList prefixes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensurePrefixesIsMutable() { + if (!prefixes_.isModifiable()) { + prefixes_ = new com.google.protobuf.LazyStringArrayList(prefixes_); + } + bitField0_ |= 0x00000008; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+         * "category" facet only contains "Action > 2022" and "Action > 2021".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 4; + * + * @return A list containing the prefixes. + */ + public com.google.protobuf.ProtocolStringList getPrefixesList() { + prefixes_.makeImmutable(); + return prefixes_; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+         * "category" facet only contains "Action > 2022" and "Action > 2021".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 4; + * + * @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 "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+         * "category" facet only contains "Action > 2022" and "Action > 2021".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 4; + * + * @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 "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+         * "category" facet only contains "Action > 2022" and "Action > 2021".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 4; + * + * @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 "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+         * "category" facet only contains "Action > 2022" and "Action > 2021".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 4; + * + * @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); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+         * "category" facet only contains "Action > 2022" and "Action > 2021".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 4; + * + * @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); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+         * "category" facet only contains "Action > 2022" and "Action > 2021".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 4; + * + * @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_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+         * "category" facet only contains "Action > 2022" and "Action > 2021".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 4; + * + * @return This builder for chaining. + */ + public Builder clearPrefixes() { + prefixes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + ; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that start with the given string prefix. For
+         * example, suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
+         * "category" facet only contains "Action > 2022" and "Action > 2021".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string prefixes = 4; + * + * @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); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList contains_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureContainsIsMutable() { + if (!contains_.isModifiable()) { + contains_ = new com.google.protobuf.LazyStringArrayList(contains_); + } + bitField0_ |= 0x00000010; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+         * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 5; + * + * @return A list containing the contains. + */ + public com.google.protobuf.ProtocolStringList getContainsList() { + contains_.makeImmutable(); + return contains_; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+         * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 5; + * + * @return The count of contains. + */ + public int getContainsCount() { + return contains_.size(); + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+         * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 5; + * + * @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 "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+         * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 5; + * + * @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 "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+         * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 5; + * + * @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); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+         * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 5; + * + * @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); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+         * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 5; + * + * @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_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+         * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 5; + * + * @return This builder for chaining. + */ + public Builder clearContains() { + contains_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + ; + onChanged(); + return this; + } + /** + * + * + *
+         * Only get facet values that contains the given strings. For example,
+         * suppose "category" has three values "Action > 2022",
+         * "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
+         * "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
+         * Only supported on textual fields. Maximum is 10.
+         * 
+ * + * repeated string contains = 5; + * + * @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); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private boolean caseInsensitive_; + /** + * + * + *
+         * True to make facet keys case insensitive when getting faceting
+         * values with prefixes or contains; false otherwise.
+         * 
+ * + * bool case_insensitive = 6; + * + * @return The caseInsensitive. + */ + @java.lang.Override + public boolean getCaseInsensitive() { + return caseInsensitive_; + } + /** + * + * + *
+         * True to make facet keys case insensitive when getting faceting
+         * values with prefixes or contains; false otherwise.
+         * 
+ * + * bool case_insensitive = 6; + * + * @param value The caseInsensitive to set. + * @return This builder for chaining. + */ + public Builder setCaseInsensitive(boolean value) { + + caseInsensitive_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+         * True to make facet keys case insensitive when getting faceting
+         * values with prefixes or contains; false otherwise.
+         * 
+ * + * bool case_insensitive = 6; + * + * @return This builder for chaining. + */ + public Builder clearCaseInsensitive() { + bitField0_ = (bitField0_ & ~0x00000020); + caseInsensitive_ = false; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+         * The order in which documents are returned.
+         *
+         * Allowed values are:
+         *
+         * * "count desc", which means order by
+         * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.count]
+         * descending.
+         *
+         * * "value desc", which means order by
+         * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1alpha.SearchResponse.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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * string order_by = 7; + * + * @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 documents are returned.
+         *
+         * Allowed values are:
+         *
+         * * "count desc", which means order by
+         * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.count]
+         * descending.
+         *
+         * * "value desc", which means order by
+         * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1alpha.SearchResponse.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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * string order_by = 7; + * + * @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 documents are returned.
+         *
+         * Allowed values are:
+         *
+         * * "count desc", which means order by
+         * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.count]
+         * descending.
+         *
+         * * "value desc", which means order by
+         * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1alpha.SearchResponse.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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * string order_by = 7; + * + * @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; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+         * The order in which documents are returned.
+         *
+         * Allowed values are:
+         *
+         * * "count desc", which means order by
+         * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.count]
+         * descending.
+         *
+         * * "value desc", which means order by
+         * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1alpha.SearchResponse.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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * string order_by = 7; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+         * The order in which documents are returned.
+         *
+         * Allowed values are:
+         *
+         * * "count desc", which means order by
+         * [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.count]
+         * descending.
+         *
+         * * "value desc", which means order by
+         * [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1alpha.SearchResponse.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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * string order_by = 7; + * + * @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; + bitField0_ |= 0x00000040; + 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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey) + private static final com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int FACET_KEY_FIELD_NUMBER = 1; + private com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey facetKey_; + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The facetKey. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey getFacetKey() { + return facetKey_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey + .getDefaultInstance() + : facetKey_; + } + /** + * + * + *
+     * Required. The facet key specification.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKeyOrBuilder + getFacetKeyOrBuilder() { + return facetKey_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey + .getDefaultInstance() + : facetKey_; + } + + public static final int LIMIT_FIELD_NUMBER = 2; + private int limit_ = 0; + /** + * + * + *
+     * 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 are 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; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList excludedFilterKeys_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+     * List of keys to exclude when faceting.
+     *
+     *
+     * By default,
+     * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     *
+     * Listing a facet key in this field allows its values to appear as facet
+     * results, even when they are filtered out of search results. Using this
+     * field does not affect what search results are returned.
+     *
+     * For example, suppose there are 100 documents with the color facet "Red"
+     * and 200 documents with the color facet "Blue". A query containing the
+     * filter "color:ANY("Red")" and having "color" as
+     * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * would by default return only "Red" documents in the search results, and
+     * also return "Red" with count 100 as the only color facet. Although there
+     * are also blue documents available, "Blue" would not be shown as an
+     * available facet value.
+     *
+     * If "color" is listed in "excludedFilterKeys", then the query returns the
+     * facet values "Red" with count 100 and "Blue" with count 200, because the
+     * "color" key is now excluded from the filter. Because this field doesn't
+     * affect search results, the search results are still correctly filtered to
+     * return only "Red" documents.
+     *
+     * 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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     *
+     * Listing a facet key in this field allows its values to appear as facet
+     * results, even when they are filtered out of search results. Using this
+     * field does not affect what search results are returned.
+     *
+     * For example, suppose there are 100 documents with the color facet "Red"
+     * and 200 documents with the color facet "Blue". A query containing the
+     * filter "color:ANY("Red")" and having "color" as
+     * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * would by default return only "Red" documents in the search results, and
+     * also return "Red" with count 100 as the only color facet. Although there
+     * are also blue documents available, "Blue" would not be shown as an
+     * available facet value.
+     *
+     * If "color" is listed in "excludedFilterKeys", then the query returns the
+     * facet values "Red" with count 100 and "Blue" with count 200, because the
+     * "color" key is now excluded from the filter. Because this field doesn't
+     * affect search results, the search results are still correctly filtered to
+     * return only "Red" documents.
+     *
+     * 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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     *
+     * Listing a facet key in this field allows its values to appear as facet
+     * results, even when they are filtered out of search results. Using this
+     * field does not affect what search results are returned.
+     *
+     * For example, suppose there are 100 documents with the color facet "Red"
+     * and 200 documents with the color facet "Blue". A query containing the
+     * filter "color:ANY("Red")" and having "color" as
+     * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * would by default return only "Red" documents in the search results, and
+     * also return "Red" with count 100 as the only color facet. Although there
+     * are also blue documents available, "Blue" would not be shown as an
+     * available facet value.
+     *
+     * If "color" is listed in "excludedFilterKeys", then the query returns the
+     * facet values "Red" with count 100 and "Blue" with count 200, because the
+     * "color" key is now excluded from the filter. Because this field doesn't
+     * affect search results, the search results are still correctly filtered to
+     * return only "Red" documents.
+     *
+     * 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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * is not excluded from the filter unless it is listed in this field.
+     *
+     * Listing a facet key in this field allows its values to appear as facet
+     * results, even when they are filtered out of search results. Using this
+     * field does not affect what search results are returned.
+     *
+     * For example, suppose there are 100 documents with the color facet "Red"
+     * and 200 documents with the color facet "Blue". A query containing the
+     * filter "color:ANY("Red")" and having "color" as
+     * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+     * would by default return only "Red" documents in the search results, and
+     * also return "Red" with count 100 as the only color facet. Although there
+     * are also blue documents available, "Blue" would not be shown as an
+     * available facet value.
+     *
+     * If "color" is listed in "excludedFilterKeys", then the query returns the
+     * facet values "Red" with count 100 and "Blue" with count 200, because the
+     * "color" key is now excluded from the filter. Because this field doesn't
+     * affect search results, the search results are still correctly filtered to
+     * return only "Red" documents.
+     *
+     * 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_ = false; + /** + * + * + *
+     * Enables dynamic position for this facet. If set to true, the position of
+     * this facet among all facets in the response is determined automatically.
+     * If dynamic facets are enabled, it is ordered together.
+     * If set to false, the position of this facet in the
+     * response is the same as in the request, and it is 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 is determined
+     * automatically.
+     *
+     * 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 enabled, which generates 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 API orders "gender" and "rating" facets.
+     * However, notice that "price" and "brands" are always
+     * ranked at first and second position because their enable_dynamic_position
+     * is 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_); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec other = + (com.google.cloud.discoveryengine.v1alpha.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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec) + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_FacetSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_FacetSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + facetKey_ = null; + if (facetKeyBuilder_ != null) { + facetKeyBuilder_.dispose(); + facetKeyBuilder_ = null; + } + limit_ = 0; + excludedFilterKeys_ = com.google.protobuf.LazyStringArrayList.emptyList(); + enableDynamicPosition_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_FacetSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec build() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec result = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.facetKey_ = facetKeyBuilder_ == null ? facetKey_ : facetKeyBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.limit_ = limit_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + excludedFilterKeys_.makeImmutable(); + result.excludedFilterKeys_ = excludedFilterKeys_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.enableDynamicPosition_ = enableDynamicPosition_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.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_ |= 0x00000004; + } else { + ensureExcludedFilterKeysIsMutable(); + excludedFilterKeys_.addAll(other.excludedFilterKeys_); + } + onChanged(); + } + if (other.getEnableDynamicPosition() != false) { + setEnableDynamicPosition(other.getEnableDynamicPosition()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getFacetKeyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + limit_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureExcludedFilterKeysIsMutable(); + excludedFilterKeys_.add(s); + break; + } // case 26 + case 32: + { + enableDynamicPosition_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey facetKey_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKeyOrBuilder> + facetKeyBuilder_; + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the facetKey field is set. + */ + public boolean hasFacetKey() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The facetKey. + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey + getFacetKey() { + if (facetKeyBuilder_ == null) { + return facetKey_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey + .getDefaultInstance() + : facetKey_; + } else { + return facetKeyBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFacetKey( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey value) { + if (facetKeyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + facetKey_ = value; + } else { + facetKeyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFacetKey( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.Builder + builderForValue) { + if (facetKeyBuilder_ == null) { + facetKey_ = builderForValue.build(); + } else { + facetKeyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeFacetKey( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey value) { + if (facetKeyBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && facetKey_ != null + && facetKey_ + != com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey + .getDefaultInstance()) { + getFacetKeyBuilder().mergeFrom(value); + } else { + facetKey_ = value; + } + } else { + facetKeyBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearFacetKey() { + bitField0_ = (bitField0_ & ~0x00000001); + facetKey_ = null; + if (facetKeyBuilder_ != null) { + facetKeyBuilder_.dispose(); + facetKeyBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.Builder + getFacetKeyBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getFacetKeyFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKeyOrBuilder + getFacetKeyOrBuilder() { + if (facetKeyBuilder_ != null) { + return facetKeyBuilder_.getMessageOrBuilder(); + } else { + return facetKey_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey + .getDefaultInstance() + : facetKey_; + } + } + /** + * + * + *
+       * Required. The facet key specification.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey facet_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKeyOrBuilder> + getFacetKeyFieldBuilder() { + if (facetKeyBuilder_ == null) { + facetKeyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.Builder, + com.google.cloud.discoveryengine.v1alpha.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 are 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 are 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; + bitField0_ |= 0x00000002; + 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 are coerced to 300.
+       *
+       * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+       * 
+ * + * int32 limit = 2; + * + * @return This builder for chaining. + */ + public Builder clearLimit() { + bitField0_ = (bitField0_ & ~0x00000002); + limit_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList excludedFilterKeys_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureExcludedFilterKeysIsMutable() { + if (!excludedFilterKeys_.isModifiable()) { + excludedFilterKeys_ = new com.google.protobuf.LazyStringArrayList(excludedFilterKeys_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       *
+       *
+       * By default,
+       * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       *
+       * Listing a facet key in this field allows its values to appear as facet
+       * results, even when they are filtered out of search results. Using this
+       * field does not affect what search results are returned.
+       *
+       * For example, suppose there are 100 documents with the color facet "Red"
+       * and 200 documents with the color facet "Blue". A query containing the
+       * filter "color:ANY("Red")" and having "color" as
+       * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * would by default return only "Red" documents in the search results, and
+       * also return "Red" with count 100 as the only color facet. Although there
+       * are also blue documents available, "Blue" would not be shown as an
+       * available facet value.
+       *
+       * If "color" is listed in "excludedFilterKeys", then the query returns the
+       * facet values "Red" with count 100 and "Blue" with count 200, because the
+       * "color" key is now excluded from the filter. Because this field doesn't
+       * affect search results, the search results are still correctly filtered to
+       * return only "Red" documents.
+       *
+       * 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() { + excludedFilterKeys_.makeImmutable(); + return excludedFilterKeys_; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       *
+       *
+       * By default,
+       * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       *
+       * Listing a facet key in this field allows its values to appear as facet
+       * results, even when they are filtered out of search results. Using this
+       * field does not affect what search results are returned.
+       *
+       * For example, suppose there are 100 documents with the color facet "Red"
+       * and 200 documents with the color facet "Blue". A query containing the
+       * filter "color:ANY("Red")" and having "color" as
+       * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * would by default return only "Red" documents in the search results, and
+       * also return "Red" with count 100 as the only color facet. Although there
+       * are also blue documents available, "Blue" would not be shown as an
+       * available facet value.
+       *
+       * If "color" is listed in "excludedFilterKeys", then the query returns the
+       * facet values "Red" with count 100 and "Blue" with count 200, because the
+       * "color" key is now excluded from the filter. Because this field doesn't
+       * affect search results, the search results are still correctly filtered to
+       * return only "Red" documents.
+       *
+       * 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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       *
+       * Listing a facet key in this field allows its values to appear as facet
+       * results, even when they are filtered out of search results. Using this
+       * field does not affect what search results are returned.
+       *
+       * For example, suppose there are 100 documents with the color facet "Red"
+       * and 200 documents with the color facet "Blue". A query containing the
+       * filter "color:ANY("Red")" and having "color" as
+       * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * would by default return only "Red" documents in the search results, and
+       * also return "Red" with count 100 as the only color facet. Although there
+       * are also blue documents available, "Blue" would not be shown as an
+       * available facet value.
+       *
+       * If "color" is listed in "excludedFilterKeys", then the query returns the
+       * facet values "Red" with count 100 and "Blue" with count 200, because the
+       * "color" key is now excluded from the filter. Because this field doesn't
+       * affect search results, the search results are still correctly filtered to
+       * return only "Red" documents.
+       *
+       * 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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       *
+       * Listing a facet key in this field allows its values to appear as facet
+       * results, even when they are filtered out of search results. Using this
+       * field does not affect what search results are returned.
+       *
+       * For example, suppose there are 100 documents with the color facet "Red"
+       * and 200 documents with the color facet "Blue". A query containing the
+       * filter "color:ANY("Red")" and having "color" as
+       * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * would by default return only "Red" documents in the search results, and
+       * also return "Red" with count 100 as the only color facet. Although there
+       * are also blue documents available, "Blue" would not be shown as an
+       * available facet value.
+       *
+       * If "color" is listed in "excludedFilterKeys", then the query returns the
+       * facet values "Red" with count 100 and "Blue" with count 200, because the
+       * "color" key is now excluded from the filter. Because this field doesn't
+       * affect search results, the search results are still correctly filtered to
+       * return only "Red" documents.
+       *
+       * 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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       *
+       * Listing a facet key in this field allows its values to appear as facet
+       * results, even when they are filtered out of search results. Using this
+       * field does not affect what search results are returned.
+       *
+       * For example, suppose there are 100 documents with the color facet "Red"
+       * and 200 documents with the color facet "Blue". A query containing the
+       * filter "color:ANY("Red")" and having "color" as
+       * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * would by default return only "Red" documents in the search results, and
+       * also return "Red" with count 100 as the only color facet. Although there
+       * are also blue documents available, "Blue" would not be shown as an
+       * available facet value.
+       *
+       * If "color" is listed in "excludedFilterKeys", then the query returns the
+       * facet values "Red" with count 100 and "Blue" with count 200, because the
+       * "color" key is now excluded from the filter. Because this field doesn't
+       * affect search results, the search results are still correctly filtered to
+       * return only "Red" documents.
+       *
+       * 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); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       *
+       *
+       * By default,
+       * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       *
+       * Listing a facet key in this field allows its values to appear as facet
+       * results, even when they are filtered out of search results. Using this
+       * field does not affect what search results are returned.
+       *
+       * For example, suppose there are 100 documents with the color facet "Red"
+       * and 200 documents with the color facet "Blue". A query containing the
+       * filter "color:ANY("Red")" and having "color" as
+       * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * would by default return only "Red" documents in the search results, and
+       * also return "Red" with count 100 as the only color facet. Although there
+       * are also blue documents available, "Blue" would not be shown as an
+       * available facet value.
+       *
+       * If "color" is listed in "excludedFilterKeys", then the query returns the
+       * facet values "Red" with count 100 and "Blue" with count 200, because the
+       * "color" key is now excluded from the filter. Because this field doesn't
+       * affect search results, the search results are still correctly filtered to
+       * return only "Red" documents.
+       *
+       * 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); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       *
+       *
+       * By default,
+       * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       *
+       * Listing a facet key in this field allows its values to appear as facet
+       * results, even when they are filtered out of search results. Using this
+       * field does not affect what search results are returned.
+       *
+       * For example, suppose there are 100 documents with the color facet "Red"
+       * and 200 documents with the color facet "Blue". A query containing the
+       * filter "color:ANY("Red")" and having "color" as
+       * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * would by default return only "Red" documents in the search results, and
+       * also return "Red" with count 100 as the only color facet. Although there
+       * are also blue documents available, "Blue" would not be shown as an
+       * available facet value.
+       *
+       * If "color" is listed in "excludedFilterKeys", then the query returns the
+       * facet values "Red" with count 100 and "Blue" with count 200, because the
+       * "color" key is now excluded from the filter. Because this field doesn't
+       * affect search results, the search results are still correctly filtered to
+       * return only "Red" documents.
+       *
+       * 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_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       *
+       *
+       * By default,
+       * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       *
+       * Listing a facet key in this field allows its values to appear as facet
+       * results, even when they are filtered out of search results. Using this
+       * field does not affect what search results are returned.
+       *
+       * For example, suppose there are 100 documents with the color facet "Red"
+       * and 200 documents with the color facet "Blue". A query containing the
+       * filter "color:ANY("Red")" and having "color" as
+       * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * would by default return only "Red" documents in the search results, and
+       * also return "Red" with count 100 as the only color facet. Although there
+       * are also blue documents available, "Blue" would not be shown as an
+       * available facet value.
+       *
+       * If "color" is listed in "excludedFilterKeys", then the query returns the
+       * facet values "Red" with count 100 and "Blue" with count 200, because the
+       * "color" key is now excluded from the filter. Because this field doesn't
+       * affect search results, the search results are still correctly filtered to
+       * return only "Red" documents.
+       *
+       * 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.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+       * List of keys to exclude when faceting.
+       *
+       *
+       * By default,
+       * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * is not excluded from the filter unless it is listed in this field.
+       *
+       * Listing a facet key in this field allows its values to appear as facet
+       * results, even when they are filtered out of search results. Using this
+       * field does not affect what search results are returned.
+       *
+       * For example, suppose there are 100 documents with the color facet "Red"
+       * and 200 documents with the color facet "Blue". A query containing the
+       * filter "color:ANY("Red")" and having "color" as
+       * [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]
+       * would by default return only "Red" documents in the search results, and
+       * also return "Red" with count 100 as the only color facet. Although there
+       * are also blue documents available, "Blue" would not be shown as an
+       * available facet value.
+       *
+       * If "color" is listed in "excludedFilterKeys", then the query returns the
+       * facet values "Red" with count 100 and "Blue" with count 200, because the
+       * "color" key is now excluded from the filter. Because this field doesn't
+       * affect search results, the search results are still correctly filtered to
+       * return only "Red" documents.
+       *
+       * 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); + bitField0_ |= 0x00000004; + 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 automatically.
+       * If dynamic facets are enabled, it is ordered together.
+       * If set to false, the position of this facet in the
+       * response is the same as in the request, and it is 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 is determined
+       * automatically.
+       *
+       * 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 enabled, which generates 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 API orders "gender" and "rating" facets.
+       * However, notice that "price" and "brands" are always
+       * ranked at first and second position because their enable_dynamic_position
+       * is 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 automatically.
+       * If dynamic facets are enabled, it is ordered together.
+       * If set to false, the position of this facet in the
+       * response is the same as in the request, and it is 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 is determined
+       * automatically.
+       *
+       * 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 enabled, which generates 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 API orders "gender" and "rating" facets.
+       * However, notice that "price" and "brands" are always
+       * ranked at first and second position because their enable_dynamic_position
+       * is false.
+       * 
+ * + * bool enable_dynamic_position = 4; + * + * @param value The enableDynamicPosition to set. + * @return This builder for chaining. + */ + public Builder setEnableDynamicPosition(boolean value) { + + enableDynamicPosition_ = value; + bitField0_ |= 0x00000008; + 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 automatically.
+       * If dynamic facets are enabled, it is ordered together.
+       * If set to false, the position of this facet in the
+       * response is the same as in the request, and it is 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 is determined
+       * automatically.
+       *
+       * 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 enabled, which generates 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 API orders "gender" and "rating" facets.
+       * However, notice that "price" and "brands" are always
+       * ranked at first and second position because their enable_dynamic_position
+       * is false.
+       * 
+ * + * bool enable_dynamic_position = 4; + * + * @return This builder for chaining. + */ + public Builder clearEnableDynamicPosition() { + bitField0_ = (bitField0_ & ~0x00000008); + 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.discoveryengine.v1alpha.SearchRequest.FacetSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec) + private static final com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface BoostSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Condition boost specifications. If a document 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 20.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec> + getConditionBoostSpecsList(); + /** + * + * + *
+     * Condition boost specifications. If a document 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 20.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + getConditionBoostSpecs(int index); + /** + * + * + *
+     * Condition boost specifications. If a document 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 20.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + int getConditionBoostSpecsCount(); + /** + * + * + *
+     * Condition boost specifications. If a document 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 20.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpecOrBuilder> + getConditionBoostSpecsOrBuilderList(); + /** + * + * + *
+     * Condition boost specifications. If a document 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 20.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder + getConditionBoostSpecsOrBuilder(int index); + } + /** + * + * + *
+   * Boost specification to boost certain documents.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec} + */ + public static final class BoostSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_BoostSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_BoostSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.Builder.class); + } + + public interface ConditionBoostSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.filter]
+       * for detail syntax and limitations.
+       *
+       * Examples:
+       *
+       * * To boost documents with document ID "doc_1" or "doc_2", and
+       * color
+       *   "Red" or "Blue":
+       *     * (id: ANY("doc_1", "doc_2")) AND (color: 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.discoveryengine.v1alpha.SearchRequest.filter]
+       * for detail syntax and limitations.
+       *
+       * Examples:
+       *
+       * * To boost documents with document ID "doc_1" or "doc_2", and
+       * color
+       *   "Red" or "Blue":
+       *     * (id: ANY("doc_1", "doc_2")) AND (color: 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 document a big promotion. However, it does not
+       * necessarily mean that the boosted document will be the top result at
+       * all times, nor that other documents 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 documents.
+       *
+       * Setting to -1.0 gives the document a big demotion. However, results
+       * that are deeply relevant might still be shown. The document 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 documents which match a condition.
+     * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec} + */ + public static final class ConditionBoostSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_BoostSpec_ConditionBoostSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + .class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + .Builder.class); + } + + public static final int CONDITION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + 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.discoveryengine.v1alpha.SearchRequest.filter]
+       * for detail syntax and limitations.
+       *
+       * Examples:
+       *
+       * * To boost documents with document ID "doc_1" or "doc_2", and
+       * color
+       *   "Red" or "Blue":
+       *     * (id: ANY("doc_1", "doc_2")) AND (color: 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.discoveryengine.v1alpha.SearchRequest.filter]
+       * for detail syntax and limitations.
+       *
+       * Examples:
+       *
+       * * To boost documents with document ID "doc_1" or "doc_2", and
+       * color
+       *   "Red" or "Blue":
+       *     * (id: ANY("doc_1", "doc_2")) AND (color: 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_ = 0F; + /** + * + * + *
+       * 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 document a big promotion. However, it does not
+       * necessarily mean that the boosted document will be the top result at
+       * all times, nor that other documents 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 documents.
+       *
+       * Setting to -1.0 gives the document a big demotion. However, results
+       * that are deeply relevant might still be shown. The document 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_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec other = + (com.google.cloud.discoveryengine.v1alpha.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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpec + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpec + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpec + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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 documents which match a condition.
+       * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec) + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_BoostSpec_ConditionBoostSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpec.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpec.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + condition_ = ""; + boost_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + build() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + result = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.condition_ = condition_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.boost_ = boost_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpec) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance()) return this; + if (!other.getCondition().isEmpty()) { + condition_ = other.condition_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getBoost() != 0F) { + setBoost(other.getBoost()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + condition_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 21: + { + boost_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object 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.discoveryengine.v1alpha.SearchRequest.filter]
+         * for detail syntax and limitations.
+         *
+         * Examples:
+         *
+         * * To boost documents with document ID "doc_1" or "doc_2", and
+         * color
+         *   "Red" or "Blue":
+         *     * (id: ANY("doc_1", "doc_2")) AND (color: 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.discoveryengine.v1alpha.SearchRequest.filter]
+         * for detail syntax and limitations.
+         *
+         * Examples:
+         *
+         * * To boost documents with document ID "doc_1" or "doc_2", and
+         * color
+         *   "Red" or "Blue":
+         *     * (id: ANY("doc_1", "doc_2")) AND (color: 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.discoveryengine.v1alpha.SearchRequest.filter]
+         * for detail syntax and limitations.
+         *
+         * Examples:
+         *
+         * * To boost documents with document ID "doc_1" or "doc_2", and
+         * color
+         *   "Red" or "Blue":
+         *     * (id: ANY("doc_1", "doc_2")) AND (color: 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; + bitField0_ |= 0x00000001; + 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.discoveryengine.v1alpha.SearchRequest.filter]
+         * for detail syntax and limitations.
+         *
+         * Examples:
+         *
+         * * To boost documents with document ID "doc_1" or "doc_2", and
+         * color
+         *   "Red" or "Blue":
+         *     * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
+         * 
+ * + * string condition = 1; + * + * @return This builder for chaining. + */ + public Builder clearCondition() { + condition_ = getDefaultInstance().getCondition(); + bitField0_ = (bitField0_ & ~0x00000001); + 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.discoveryengine.v1alpha.SearchRequest.filter]
+         * for detail syntax and limitations.
+         *
+         * Examples:
+         *
+         * * To boost documents with document ID "doc_1" or "doc_2", and
+         * color
+         *   "Red" or "Blue":
+         *     * (id: ANY("doc_1", "doc_2")) AND (color: 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; + bitField0_ |= 0x00000001; + 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 document a big promotion. However, it does not
+         * necessarily mean that the boosted document will be the top result at
+         * all times, nor that other documents 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 documents.
+         *
+         * Setting to -1.0 gives the document a big demotion. However, results
+         * that are deeply relevant might still be shown. The document 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 document a big promotion. However, it does not
+         * necessarily mean that the boosted document will be the top result at
+         * all times, nor that other documents 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 documents.
+         *
+         * Setting to -1.0 gives the document a big demotion. However, results
+         * that are deeply relevant might still be shown. The document 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; + bitField0_ |= 0x00000002; + 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 document a big promotion. However, it does not
+         * necessarily mean that the boosted document will be the top result at
+         * all times, nor that other documents 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 documents.
+         *
+         * Setting to -1.0 gives the document a big demotion. However, results
+         * that are deeply relevant might still be shown. The document 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() { + bitField0_ = (bitField0_ & ~0x00000002); + 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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec) + private static final com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpec(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int CONDITION_BOOST_SPECS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec> + conditionBoostSpecs_; + /** + * + * + *
+     * Condition boost specifications. If a document 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 20.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec> + getConditionBoostSpecsList() { + return conditionBoostSpecs_; + } + /** + * + * + *
+     * Condition boost specifications. If a document 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 20.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpecOrBuilder> + getConditionBoostSpecsOrBuilderList() { + return conditionBoostSpecs_; + } + /** + * + * + *
+     * Condition boost specifications. If a document 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 20.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public int getConditionBoostSpecsCount() { + return conditionBoostSpecs_.size(); + } + /** + * + * + *
+     * Condition boost specifications. If a document 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 20.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + getConditionBoostSpecs(int index) { + return conditionBoostSpecs_.get(index); + } + /** + * + * + *
+     * Condition boost specifications. If a document 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 20.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpecOrBuilder + getConditionBoostSpecsOrBuilder(int index) { + return conditionBoostSpecs_.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 < conditionBoostSpecs_.size(); i++) { + output.writeMessage(1, conditionBoostSpecs_.get(i)); + } + getUnknownFields().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)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec other = + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec) obj; + + if (!getConditionBoostSpecsList().equals(other.getConditionBoostSpecsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getConditionBoostSpecsCount() > 0) { + hash = (37 * hash) + CONDITION_BOOST_SPECS_FIELD_NUMBER; + hash = (53 * hash) + getConditionBoostSpecsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.BoostSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.BoostSpec parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.BoostSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.BoostSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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 documents.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec) + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_BoostSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_BoostSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (conditionBoostSpecsBuilder_ == null) { + conditionBoostSpecs_ = java.util.Collections.emptyList(); + } else { + conditionBoostSpecs_ = null; + conditionBoostSpecsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_BoostSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec build() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec result = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec result) { + if (conditionBoostSpecsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + conditionBoostSpecs_ = java.util.Collections.unmodifiableList(conditionBoostSpecs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.conditionBoostSpecs_ = conditionBoostSpecs_; + } else { + result.conditionBoostSpecs_ = conditionBoostSpecsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.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_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpec + m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpec.parser(), + extensionRegistry); + if (conditionBoostSpecsBuilder_ == null) { + ensureConditionBoostSpecsIsMutable(); + conditionBoostSpecs_.add(m); + } else { + conditionBoostSpecsBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec> + conditionBoostSpecs_ = java.util.Collections.emptyList(); + + private void ensureConditionBoostSpecsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + conditionBoostSpecs_ = + new java.util.ArrayList< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpec>(conditionBoostSpecs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + .Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpecOrBuilder> + conditionBoostSpecsBuilder_; + + /** + * + * + *
+       * Condition boost specifications. If a document 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 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec> + getConditionBoostSpecsList() { + if (conditionBoostSpecsBuilder_ == null) { + return java.util.Collections.unmodifiableList(conditionBoostSpecs_); + } else { + return conditionBoostSpecsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Condition boost specifications. If a document 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 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.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 document 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 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + getConditionBoostSpecs(int index) { + if (conditionBoostSpecsBuilder_ == null) { + return conditionBoostSpecs_.get(index); + } else { + return conditionBoostSpecsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Condition boost specifications. If a document 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 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder setConditionBoostSpecs( + int index, + com.google.cloud.discoveryengine.v1alpha.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 document 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 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder setConditionBoostSpecs( + int index, + com.google.cloud.discoveryengine.v1alpha.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 document 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 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addConditionBoostSpecs( + com.google.cloud.discoveryengine.v1alpha.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 document 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 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addConditionBoostSpecs( + int index, + com.google.cloud.discoveryengine.v1alpha.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 document 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 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addConditionBoostSpecs( + com.google.cloud.discoveryengine.v1alpha.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 document 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 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addConditionBoostSpecs( + int index, + com.google.cloud.discoveryengine.v1alpha.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 document 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 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public Builder addAllConditionBoostSpecs( + java.lang.Iterable< + ? extends + com.google.cloud.discoveryengine.v1alpha.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 document 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 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.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 document 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 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.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 document 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 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + .Builder + getConditionBoostSpecsBuilder(int index) { + return getConditionBoostSpecsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Condition boost specifications. If a document 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 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpecOrBuilder + getConditionBoostSpecsOrBuilder(int index) { + if (conditionBoostSpecsBuilder_ == null) { + return conditionBoostSpecs_.get(index); + } else { + return conditionBoostSpecsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Condition boost specifications. If a document 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 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpecOrBuilder> + getConditionBoostSpecsOrBuilderList() { + if (conditionBoostSpecsBuilder_ != null) { + return conditionBoostSpecsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(conditionBoostSpecs_); + } + } + /** + * + * + *
+       * Condition boost specifications. If a document 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 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + .Builder + addConditionBoostSpecsBuilder() { + return getConditionBoostSpecsFieldBuilder() + .addBuilder( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance()); + } + /** + * + * + *
+       * Condition boost specifications. If a document 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 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + .Builder + addConditionBoostSpecsBuilder(int index) { + return getConditionBoostSpecsFieldBuilder() + .addBuilder( + index, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + .getDefaultInstance()); + } + /** + * + * + *
+       * Condition boost specifications. If a document 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 20.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + .Builder> + getConditionBoostSpecsBuilderList() { + return getConditionBoostSpecsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + .Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpecOrBuilder> + getConditionBoostSpecsFieldBuilder() { + if (conditionBoostSpecsBuilder_ == null) { + conditionBoostSpecsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .ConditionBoostSpecOrBuilder>( + conditionBoostSpecs_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + conditionBoostSpecs_ = null; + } + return conditionBoostSpecsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec) + private static final com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface QueryExpansionSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The condition under which query expansion should occur. Default to
+     * [Condition.DISABLED][google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The condition. + */ + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec} + */ + public static final class QueryExpansionSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_QueryExpansionSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_QueryExpansionSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Builder + .class); + } + + /** + * + * + *
+     * Enum describing under which condition query expansion should occur.
+     * 
+ * + * Protobuf enum {@code + * google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition} + */ + public enum Condition implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unspecified query expansion condition. In this case, server behavior
+       * defaults to
+       * [Condition.DISABLED][google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.total_size]
+       * is zero.
+       * 
+ * + * DISABLED = 1; + */ + DISABLED(1), + /** + * + * + *
+       * Automatic query expansion built by the Search API.
+       * 
+ * + * AUTO = 2; + */ + AUTO(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Unspecified query expansion condition. In this case, server behavior
+       * defaults to
+       * [Condition.DISABLED][google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.total_size]
+       * is zero.
+       * 
+ * + * DISABLED = 1; + */ + public static final int DISABLED_VALUE = 1; + /** + * + * + *
+       * Automatic query expansion built by the Search API.
+       * 
+ * + * AUTO = 2; + */ + public static final int AUTO_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 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 2: + 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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition) + } + + public static final int CONDITION_FIELD_NUMBER = 1; + private int condition_ = 0; + /** + * + * + *
+     * The condition under which query expansion should occur. Default to
+     * [Condition.DISABLED][google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The condition. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition + getCondition() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition result = + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition + .forNumber(condition_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition + .UNRECOGNIZED + : result; + } + + public static final int PIN_UNEXPANDED_RESULTS_FIELD_NUMBER = 2; + private boolean pinUnexpandedResults_ = false; + /** + * + * + *
+     * 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.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition + .CONDITION_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, condition_); + } + if (pinUnexpandedResults_ != false) { + output.writeBool(2, pinUnexpandedResults_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (condition_ + != com.google.cloud.discoveryengine.v1alpha.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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec other = + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec) obj; + + if (condition_ != other.condition_) return false; + if (getPinUnexpandedResults() != other.getPinUnexpandedResults()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec) + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_QueryExpansionSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_QueryExpansionSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Builder + .class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + condition_ = 0; + pinUnexpandedResults_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_QueryExpansionSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec build() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec + buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec result = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.condition_ = condition_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pinUnexpandedResults_ = pinUnexpandedResults_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec + .getDefaultInstance()) return this; + if (other.condition_ != 0) { + setConditionValue(other.getConditionValue()); + } + if (other.getPinUnexpandedResults() != false) { + setPinUnexpandedResults(other.getPinUnexpandedResults()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + condition_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + pinUnexpandedResults_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int condition_ = 0; + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return The condition. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition + getCondition() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition result = + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition + .forNumber(condition_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition + .UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @param value The condition to set. + * @return This builder for chaining. + */ + public Builder setCondition( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + condition_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The condition under which query expansion should occur. Default to
+       * [Condition.DISABLED][google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition condition = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearCondition() { + bitField0_ = (bitField0_ & ~0x00000001); + 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; + bitField0_ |= 0x00000002; + 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() { + bitField0_ = (bitField0_ & ~0x00000002); + 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.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec) + private static final com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SpellCorrectionSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The mode under which spell correction should take effect to
+     * replace the original search query. Default to
+     * [Mode.AUTO][google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode mode = 1; + * + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + /** + * + * + *
+     * The mode under which spell correction should take effect to
+     * replace the original search query. Default to
+     * [Mode.AUTO][google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode mode = 1; + * + * + * @return The mode. + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode getMode(); + } + /** + * + * + *
+   * The specification for query spell correction.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec} + */ + public static final class SpellCorrectionSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec) + SpellCorrectionSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use SpellCorrectionSpec.newBuilder() to construct. + private SpellCorrectionSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SpellCorrectionSpec() { + mode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SpellCorrectionSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_SpellCorrectionSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_SpellCorrectionSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Builder + .class); + } + + /** + * + * + *
+     * Enum describing under which mode spell correction should occur.
+     * 
+ * + * Protobuf enum {@code + * google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode} + */ + public enum Mode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unspecified spell correction mode. In this case, server behavior
+       * defaults to
+       * [Mode.AUTO][google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+       * 
+ * + * MODE_UNSPECIFIED = 0; + */ + MODE_UNSPECIFIED(0), + /** + * + * + *
+       * Search API will try to find a spell suggestion if there
+       * is any and put in the
+       * [SearchResponse.corrected_query][google.cloud.discoveryengine.v1alpha.SearchResponse.corrected_query].
+       * The spell suggestion will not be used as the search query.
+       * 
+ * + * SUGGESTION_ONLY = 1; + */ + SUGGESTION_ONLY(1), + /** + * + * + *
+       * Automatic spell correction built by the Search API. Search will
+       * be based on the corrected query if found.
+       * 
+ * + * AUTO = 2; + */ + AUTO(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Unspecified spell correction mode. In this case, server behavior
+       * defaults to
+       * [Mode.AUTO][google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+       * 
+ * + * MODE_UNSPECIFIED = 0; + */ + public static final int MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Search API will try to find a spell suggestion if there
+       * is any and put in the
+       * [SearchResponse.corrected_query][google.cloud.discoveryengine.v1alpha.SearchResponse.corrected_query].
+       * The spell suggestion will not be used as the search query.
+       * 
+ * + * SUGGESTION_ONLY = 1; + */ + public static final int SUGGESTION_ONLY_VALUE = 1; + /** + * + * + *
+       * Automatic spell correction built by the Search API. Search will
+       * be based on the corrected query if found.
+       * 
+ * + * AUTO = 2; + */ + public static final int AUTO_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 SUGGESTION_ONLY; + case 2: + 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 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.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + .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.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode) + } + + public static final int MODE_FIELD_NUMBER = 1; + private int mode_ = 0; + /** + * + * + *
+     * The mode under which spell correction should take effect to
+     * replace the original search query. Default to
+     * [Mode.AUTO][google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode mode = 1; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+     * The mode under which spell correction should take effect to
+     * replace the original search query. Default to
+     * [Mode.AUTO][google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode mode = 1; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode + getMode() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode result = + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode.forNumber( + mode_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.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.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode + .MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, mode_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (mode_ + != com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode + .MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, mode_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec other = + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec) obj; + + if (mode_ != other.mode_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 query spell correction.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec) + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_SpellCorrectionSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_SpellCorrectionSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Builder + .class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + mode_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_SpellCorrectionSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec build() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec result = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.mode_ = mode_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + .getDefaultInstance()) return this; + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + mode_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int mode_ = 0; + /** + * + * + *
+       * The mode under which spell correction should take effect to
+       * replace the original search query. Default to
+       * [Mode.AUTO][google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode mode = 1; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+       * The mode under which spell correction should take effect to
+       * replace the original search query. Default to
+       * [Mode.AUTO][google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The mode under which spell correction should take effect to
+       * replace the original search query. Default to
+       * [Mode.AUTO][google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode mode = 1; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode + getMode() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode result = + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode + .forNumber(mode_); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode + .UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The mode under which spell correction should take effect to
+       * replace the original search query. Default to
+       * [Mode.AUTO][google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode mode = 1; + * + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + mode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The mode under which spell correction should take effect to
+       * replace the original search query. Default to
+       * [Mode.AUTO][google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode mode = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearMode() { + bitField0_ = (bitField0_ & ~0x00000001); + 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.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec) + private static final com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec(); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SpellCorrectionSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ContentSearchSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * If `snippetSpec` is not specified, snippets are not included in the
+     * search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; + * + * + * @return Whether the snippetSpec field is set. + */ + boolean hasSnippetSpec(); + /** + * + * + *
+     * If `snippetSpec` is not specified, snippets are not included in the
+     * search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; + * + * + * @return The snippetSpec. + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + getSnippetSpec(); + /** + * + * + *
+     * If `snippetSpec` is not specified, snippets are not included in the
+     * search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpecOrBuilder + getSnippetSpecOrBuilder(); + + /** + * + * + *
+     * If `summarySpec` is not specified, summaries are not included in the
+     * search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + * + * @return Whether the summarySpec field is set. + */ + boolean hasSummarySpec(); + /** + * + * + *
+     * If `summarySpec` is not specified, summaries are not included in the
+     * search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + * + * @return The summarySpec. + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + getSummarySpec(); + /** + * + * + *
+     * If `summarySpec` is not specified, summaries are not included in the
+     * search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpecOrBuilder + getSummarySpecOrBuilder(); + + /** + * + * + *
+     * If there is no extractive_content_spec provided, there will be no
+     * extractive answer in the search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec extractive_content_spec = 3; + * + * + * @return Whether the extractiveContentSpec field is set. + */ + boolean hasExtractiveContentSpec(); + /** + * + * + *
+     * If there is no extractive_content_spec provided, there will be no
+     * extractive answer in the search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec extractive_content_spec = 3; + * + * + * @return The extractiveContentSpec. + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec + getExtractiveContentSpec(); + /** + * + * + *
+     * If there is no extractive_content_spec provided, there will be no
+     * extractive answer in the search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec extractive_content_spec = 3; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpecOrBuilder + getExtractiveContentSpecOrBuilder(); + } + /** + * + * + *
+   * A specification for configuring the behavior of content search.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec} + */ + public static final class ContentSearchSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec) + ContentSearchSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use ContentSearchSpec.newBuilder() to construct. + private ContentSearchSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ContentSearchSpec() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ContentSearchSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.Builder + .class); + } + + public interface SnippetSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * [DEPRECATED] This field is deprecated. To control snippet return, use
+       * `return_snippet` field. For backwards compatibility, we will return
+       * snippet if max_snippet_count > 0.
+       * 
+ * + * int32 max_snippet_count = 1 [deprecated = true]; + * + * @deprecated + * google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec.max_snippet_count + * is deprecated. See google/cloud/discoveryengine/v1alpha/search_service.proto;l=308 + * @return The maxSnippetCount. + */ + @java.lang.Deprecated + int getMaxSnippetCount(); + + /** + * + * + *
+       * [DEPRECATED] This field is deprecated and will have no affect on the
+       * snippet.
+       * 
+ * + * bool reference_only = 2 [deprecated = true]; + * + * @deprecated + * google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec.reference_only + * is deprecated. See google/cloud/discoveryengine/v1alpha/search_service.proto;l=312 + * @return The referenceOnly. + */ + @java.lang.Deprecated + boolean getReferenceOnly(); + + /** + * + * + *
+       * If `true`, then return snippet. If no snippet can be generated, we
+       * return "No snippet is available for this page." A `snippet_status` with
+       * `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
+       * 
+ * + * bool return_snippet = 3; + * + * @return The returnSnippet. + */ + boolean getReturnSnippet(); + } + /** + * + * + *
+     * A specification for configuring snippets in a search response.
+     * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec} + */ + public static final class SnippetSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec) + SnippetSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use SnippetSpec.newBuilder() to construct. + private SnippetSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SnippetSpec() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SnippetSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_SnippetSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_SnippetSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + .class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + .Builder.class); + } + + public static final int MAX_SNIPPET_COUNT_FIELD_NUMBER = 1; + private int maxSnippetCount_ = 0; + /** + * + * + *
+       * [DEPRECATED] This field is deprecated. To control snippet return, use
+       * `return_snippet` field. For backwards compatibility, we will return
+       * snippet if max_snippet_count > 0.
+       * 
+ * + * int32 max_snippet_count = 1 [deprecated = true]; + * + * @deprecated + * google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec.max_snippet_count + * is deprecated. See google/cloud/discoveryengine/v1alpha/search_service.proto;l=308 + * @return The maxSnippetCount. + */ + @java.lang.Override + @java.lang.Deprecated + public int getMaxSnippetCount() { + return maxSnippetCount_; + } + + public static final int REFERENCE_ONLY_FIELD_NUMBER = 2; + private boolean referenceOnly_ = false; + /** + * + * + *
+       * [DEPRECATED] This field is deprecated and will have no affect on the
+       * snippet.
+       * 
+ * + * bool reference_only = 2 [deprecated = true]; + * + * @deprecated + * google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec.reference_only + * is deprecated. See google/cloud/discoveryengine/v1alpha/search_service.proto;l=312 + * @return The referenceOnly. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean getReferenceOnly() { + return referenceOnly_; + } + + public static final int RETURN_SNIPPET_FIELD_NUMBER = 3; + private boolean returnSnippet_ = false; + /** + * + * + *
+       * If `true`, then return snippet. If no snippet can be generated, we
+       * return "No snippet is available for this page." A `snippet_status` with
+       * `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
+       * 
+ * + * bool return_snippet = 3; + * + * @return The returnSnippet. + */ + @java.lang.Override + public boolean getReturnSnippet() { + return returnSnippet_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (maxSnippetCount_ != 0) { + output.writeInt32(1, maxSnippetCount_); + } + if (referenceOnly_ != false) { + output.writeBool(2, referenceOnly_); + } + if (returnSnippet_ != false) { + output.writeBool(3, returnSnippet_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (maxSnippetCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, maxSnippetCount_); + } + if (referenceOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, referenceOnly_); + } + if (returnSnippet_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, returnSnippet_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec other = + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec) + obj; + + if (getMaxSnippetCount() != other.getMaxSnippetCount()) return false; + if (getReferenceOnly() != other.getReferenceOnly()) return false; + if (getReturnSnippet() != other.getReturnSnippet()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MAX_SNIPPET_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMaxSnippetCount(); + hash = (37 * hash) + REFERENCE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReferenceOnly()); + hash = (37 * hash) + RETURN_SNIPPET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReturnSnippet()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 specification for configuring snippets in a search response.
+       * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec) + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_SnippetSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_SnippetSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + maxSnippetCount_ = 0; + referenceOnly_ = false; + returnSnippet_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_SnippetSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + build() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + result = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.maxSnippetCount_ = maxSnippetCount_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.referenceOnly_ = referenceOnly_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.returnSnippet_ = returnSnippet_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec.getDefaultInstance()) return this; + if (other.getMaxSnippetCount() != 0) { + setMaxSnippetCount(other.getMaxSnippetCount()); + } + if (other.getReferenceOnly() != false) { + setReferenceOnly(other.getReferenceOnly()); + } + if (other.getReturnSnippet() != false) { + setReturnSnippet(other.getReturnSnippet()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + maxSnippetCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + referenceOnly_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + returnSnippet_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int maxSnippetCount_; + /** + * + * + *
+         * [DEPRECATED] This field is deprecated. To control snippet return, use
+         * `return_snippet` field. For backwards compatibility, we will return
+         * snippet if max_snippet_count > 0.
+         * 
+ * + * int32 max_snippet_count = 1 [deprecated = true]; + * + * @deprecated + * google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec.max_snippet_count + * is deprecated. See google/cloud/discoveryengine/v1alpha/search_service.proto;l=308 + * @return The maxSnippetCount. + */ + @java.lang.Override + @java.lang.Deprecated + public int getMaxSnippetCount() { + return maxSnippetCount_; + } + /** + * + * + *
+         * [DEPRECATED] This field is deprecated. To control snippet return, use
+         * `return_snippet` field. For backwards compatibility, we will return
+         * snippet if max_snippet_count > 0.
+         * 
+ * + * int32 max_snippet_count = 1 [deprecated = true]; + * + * @deprecated + * google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec.max_snippet_count + * is deprecated. See google/cloud/discoveryengine/v1alpha/search_service.proto;l=308 + * @param value The maxSnippetCount to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setMaxSnippetCount(int value) { + + maxSnippetCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * [DEPRECATED] This field is deprecated. To control snippet return, use
+         * `return_snippet` field. For backwards compatibility, we will return
+         * snippet if max_snippet_count > 0.
+         * 
+ * + * int32 max_snippet_count = 1 [deprecated = true]; + * + * @deprecated + * google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec.max_snippet_count + * is deprecated. See google/cloud/discoveryengine/v1alpha/search_service.proto;l=308 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearMaxSnippetCount() { + bitField0_ = (bitField0_ & ~0x00000001); + maxSnippetCount_ = 0; + onChanged(); + return this; + } + + private boolean referenceOnly_; + /** + * + * + *
+         * [DEPRECATED] This field is deprecated and will have no affect on the
+         * snippet.
+         * 
+ * + * bool reference_only = 2 [deprecated = true]; + * + * @deprecated + * google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec.reference_only + * is deprecated. See google/cloud/discoveryengine/v1alpha/search_service.proto;l=312 + * @return The referenceOnly. + */ + @java.lang.Override + @java.lang.Deprecated + public boolean getReferenceOnly() { + return referenceOnly_; + } + /** + * + * + *
+         * [DEPRECATED] This field is deprecated and will have no affect on the
+         * snippet.
+         * 
+ * + * bool reference_only = 2 [deprecated = true]; + * + * @deprecated + * google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec.reference_only + * is deprecated. See google/cloud/discoveryengine/v1alpha/search_service.proto;l=312 + * @param value The referenceOnly to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setReferenceOnly(boolean value) { + + referenceOnly_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * [DEPRECATED] This field is deprecated and will have no affect on the
+         * snippet.
+         * 
+ * + * bool reference_only = 2 [deprecated = true]; + * + * @deprecated + * google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec.reference_only + * is deprecated. See google/cloud/discoveryengine/v1alpha/search_service.proto;l=312 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearReferenceOnly() { + bitField0_ = (bitField0_ & ~0x00000002); + referenceOnly_ = false; + onChanged(); + return this; + } + + private boolean returnSnippet_; + /** + * + * + *
+         * If `true`, then return snippet. If no snippet can be generated, we
+         * return "No snippet is available for this page." A `snippet_status` with
+         * `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
+         * 
+ * + * bool return_snippet = 3; + * + * @return The returnSnippet. + */ + @java.lang.Override + public boolean getReturnSnippet() { + return returnSnippet_; + } + /** + * + * + *
+         * If `true`, then return snippet. If no snippet can be generated, we
+         * return "No snippet is available for this page." A `snippet_status` with
+         * `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
+         * 
+ * + * bool return_snippet = 3; + * + * @param value The returnSnippet to set. + * @return This builder for chaining. + */ + public Builder setReturnSnippet(boolean value) { + + returnSnippet_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+         * If `true`, then return snippet. If no snippet can be generated, we
+         * return "No snippet is available for this page." A `snippet_status` with
+         * `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
+         * 
+ * + * bool return_snippet = 3; + * + * @return This builder for chaining. + */ + public Builder clearReturnSnippet() { + bitField0_ = (bitField0_ & ~0x00000004); + returnSnippet_ = 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.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec) + private static final com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec(); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SnippetSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SummarySpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The number of top results to generate the summary from. If the number
+       * of results returned is less than `summaryResultCount`, the summary is
+       * generated from all of the results.
+       *
+       * At most five results can be used to generate a summary.
+       * 
+ * + * int32 summary_result_count = 1; + * + * @return The summaryResultCount. + */ + int getSummaryResultCount(); + + /** + * + * + *
+       * Specifies whether to include citations in the summary. The default
+       * value is `false`.
+       *
+       * When this field is set to `true`, summaries include in-line citation
+       * numbers.
+       *
+       * Example summary including citations:
+       *
+       * BigQuery is Google Cloud's fully managed and completely serverless
+       * enterprise data warehouse [1]. BigQuery supports all data types, works
+       * across clouds, and has built-in machine learning and business
+       * intelligence, all within a unified platform [2, 3].
+       *
+       * The citation numbers refer to the returned search results and are
+       * 1-indexed. For example, [1] means that the sentence is attributed to
+       * the first search result. [2, 3] means that the sentence is attributed
+       * to both the second and third search results.
+       * 
+ * + * bool include_citations = 2; + * + * @return The includeCitations. + */ + boolean getIncludeCitations(); + + /** + * + * + *
+       * Specifies whether to filter out adversarial queries. The default value
+       * is `false`.
+       *
+       * Google employs search-query classification to detect adversarial
+       * queries. No summary is returned if the search query is classified as an
+       * adversarial query. For example, a user might ask a question regarding
+       * negative comments about the company or submit a query designed to
+       * generate unsafe, policy-violating output. If this field is set to
+       * `true`, we skip generating summaries for adversarial queries and return
+       * fallback messages instead.
+       * 
+ * + * bool ignore_adversarial_query = 3; + * + * @return The ignoreAdversarialQuery. + */ + boolean getIgnoreAdversarialQuery(); + + /** + * + * + *
+       * Specifies whether to filter out queries that are not summary-seeking.
+       * The default value is `false`.
+       *
+       * Google employs search-query classification to detect summary-seeking
+       * queries. No summary is returned if the search query is classified as a
+       * non-summary seeking query. For example, `why is the sky blue` and `Who
+       * is the best soccer player in the world?` are summary-seeking queries,
+       * but `SFO airport` and `world cup 2026` are not. They are most likely
+       * navigational queries. If this field is set to `true`, we skip
+       * generating summaries for non-summary seeking queries and return
+       * fallback messages instead.
+       * 
+ * + * bool ignore_non_summary_seeking_query = 4; + * + * @return The ignoreNonSummarySeekingQuery. + */ + boolean getIgnoreNonSummarySeekingQuery(); + + /** + * + * + *
+       * Language code for Summary. Use language tags defined by
+       * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+       * Note: This is an experimental feature.
+       * 
+ * + * string language_code = 6; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+       * Language code for Summary. Use language tags defined by
+       * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+       * Note: This is an experimental feature.
+       * 
+ * + * string language_code = 6; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); + } + /** + * + * + *
+     * A specification for configuring a summary returned in a search
+     * response.
+     * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec} + */ + public static final class SummarySpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec) + SummarySpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use SummarySpec.newBuilder() to construct. + private SummarySpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SummarySpec() { + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SummarySpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_SummarySpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_SummarySpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + .class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + .Builder.class); + } + + public static final int SUMMARY_RESULT_COUNT_FIELD_NUMBER = 1; + private int summaryResultCount_ = 0; + /** + * + * + *
+       * The number of top results to generate the summary from. If the number
+       * of results returned is less than `summaryResultCount`, the summary is
+       * generated from all of the results.
+       *
+       * At most five results can be used to generate a summary.
+       * 
+ * + * int32 summary_result_count = 1; + * + * @return The summaryResultCount. + */ + @java.lang.Override + public int getSummaryResultCount() { + return summaryResultCount_; + } + + public static final int INCLUDE_CITATIONS_FIELD_NUMBER = 2; + private boolean includeCitations_ = false; + /** + * + * + *
+       * Specifies whether to include citations in the summary. The default
+       * value is `false`.
+       *
+       * When this field is set to `true`, summaries include in-line citation
+       * numbers.
+       *
+       * Example summary including citations:
+       *
+       * BigQuery is Google Cloud's fully managed and completely serverless
+       * enterprise data warehouse [1]. BigQuery supports all data types, works
+       * across clouds, and has built-in machine learning and business
+       * intelligence, all within a unified platform [2, 3].
+       *
+       * The citation numbers refer to the returned search results and are
+       * 1-indexed. For example, [1] means that the sentence is attributed to
+       * the first search result. [2, 3] means that the sentence is attributed
+       * to both the second and third search results.
+       * 
+ * + * bool include_citations = 2; + * + * @return The includeCitations. + */ + @java.lang.Override + public boolean getIncludeCitations() { + return includeCitations_; + } + + public static final int IGNORE_ADVERSARIAL_QUERY_FIELD_NUMBER = 3; + private boolean ignoreAdversarialQuery_ = false; + /** + * + * + *
+       * Specifies whether to filter out adversarial queries. The default value
+       * is `false`.
+       *
+       * Google employs search-query classification to detect adversarial
+       * queries. No summary is returned if the search query is classified as an
+       * adversarial query. For example, a user might ask a question regarding
+       * negative comments about the company or submit a query designed to
+       * generate unsafe, policy-violating output. If this field is set to
+       * `true`, we skip generating summaries for adversarial queries and return
+       * fallback messages instead.
+       * 
+ * + * bool ignore_adversarial_query = 3; + * + * @return The ignoreAdversarialQuery. + */ + @java.lang.Override + public boolean getIgnoreAdversarialQuery() { + return ignoreAdversarialQuery_; + } + + public static final int IGNORE_NON_SUMMARY_SEEKING_QUERY_FIELD_NUMBER = 4; + private boolean ignoreNonSummarySeekingQuery_ = false; + /** + * + * + *
+       * Specifies whether to filter out queries that are not summary-seeking.
+       * The default value is `false`.
+       *
+       * Google employs search-query classification to detect summary-seeking
+       * queries. No summary is returned if the search query is classified as a
+       * non-summary seeking query. For example, `why is the sky blue` and `Who
+       * is the best soccer player in the world?` are summary-seeking queries,
+       * but `SFO airport` and `world cup 2026` are not. They are most likely
+       * navigational queries. If this field is set to `true`, we skip
+       * generating summaries for non-summary seeking queries and return
+       * fallback messages instead.
+       * 
+ * + * bool ignore_non_summary_seeking_query = 4; + * + * @return The ignoreNonSummarySeekingQuery. + */ + @java.lang.Override + public boolean getIgnoreNonSummarySeekingQuery() { + return ignoreNonSummarySeekingQuery_; + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object languageCode_ = ""; + /** + * + * + *
+       * Language code for Summary. Use language tags defined by
+       * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+       * Note: This is an experimental feature.
+       * 
+ * + * string language_code = 6; + * + * @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 code for Summary. Use language tags defined by
+       * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+       * Note: This is an experimental feature.
+       * 
+ * + * string language_code = 6; + * + * @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 (summaryResultCount_ != 0) { + output.writeInt32(1, summaryResultCount_); + } + if (includeCitations_ != false) { + output.writeBool(2, includeCitations_); + } + if (ignoreAdversarialQuery_ != false) { + output.writeBool(3, ignoreAdversarialQuery_); + } + if (ignoreNonSummarySeekingQuery_ != false) { + output.writeBool(4, ignoreNonSummarySeekingQuery_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, languageCode_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (summaryResultCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, summaryResultCount_); + } + if (includeCitations_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, includeCitations_); + } + if (ignoreAdversarialQuery_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, ignoreAdversarialQuery_); + } + if (ignoreNonSummarySeekingQuery_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 4, ignoreNonSummarySeekingQuery_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, languageCode_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec other = + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec) + obj; + + if (getSummaryResultCount() != other.getSummaryResultCount()) return false; + if (getIncludeCitations() != other.getIncludeCitations()) return false; + if (getIgnoreAdversarialQuery() != other.getIgnoreAdversarialQuery()) return false; + if (getIgnoreNonSummarySeekingQuery() != other.getIgnoreNonSummarySeekingQuery()) + return false; + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SUMMARY_RESULT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getSummaryResultCount(); + hash = (37 * hash) + INCLUDE_CITATIONS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIncludeCitations()); + hash = (37 * hash) + IGNORE_ADVERSARIAL_QUERY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIgnoreAdversarialQuery()); + hash = (37 * hash) + IGNORE_NON_SUMMARY_SEEKING_QUERY_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashBoolean(getIgnoreNonSummarySeekingQuery()); + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 specification for configuring a summary returned in a search
+       * response.
+       * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec) + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_SummarySpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_SummarySpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + summaryResultCount_ = 0; + includeCitations_ = false; + ignoreAdversarialQuery_ = false; + ignoreNonSummarySeekingQuery_ = false; + languageCode_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_SummarySpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + build() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + result = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.summaryResultCount_ = summaryResultCount_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.includeCitations_ = includeCitations_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ignoreAdversarialQuery_ = ignoreAdversarialQuery_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.ignoreNonSummarySeekingQuery_ = ignoreNonSummarySeekingQuery_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.languageCode_ = languageCode_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec.getDefaultInstance()) return this; + if (other.getSummaryResultCount() != 0) { + setSummaryResultCount(other.getSummaryResultCount()); + } + if (other.getIncludeCitations() != false) { + setIncludeCitations(other.getIncludeCitations()); + } + if (other.getIgnoreAdversarialQuery() != false) { + setIgnoreAdversarialQuery(other.getIgnoreAdversarialQuery()); + } + if (other.getIgnoreNonSummarySeekingQuery() != false) { + setIgnoreNonSummarySeekingQuery(other.getIgnoreNonSummarySeekingQuery()); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + summaryResultCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + includeCitations_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + ignoreAdversarialQuery_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + ignoreNonSummarySeekingQuery_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 50: + { + languageCode_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int summaryResultCount_; + /** + * + * + *
+         * The number of top results to generate the summary from. If the number
+         * of results returned is less than `summaryResultCount`, the summary is
+         * generated from all of the results.
+         *
+         * At most five results can be used to generate a summary.
+         * 
+ * + * int32 summary_result_count = 1; + * + * @return The summaryResultCount. + */ + @java.lang.Override + public int getSummaryResultCount() { + return summaryResultCount_; + } + /** + * + * + *
+         * The number of top results to generate the summary from. If the number
+         * of results returned is less than `summaryResultCount`, the summary is
+         * generated from all of the results.
+         *
+         * At most five results can be used to generate a summary.
+         * 
+ * + * int32 summary_result_count = 1; + * + * @param value The summaryResultCount to set. + * @return This builder for chaining. + */ + public Builder setSummaryResultCount(int value) { + + summaryResultCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The number of top results to generate the summary from. If the number
+         * of results returned is less than `summaryResultCount`, the summary is
+         * generated from all of the results.
+         *
+         * At most five results can be used to generate a summary.
+         * 
+ * + * int32 summary_result_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearSummaryResultCount() { + bitField0_ = (bitField0_ & ~0x00000001); + summaryResultCount_ = 0; + onChanged(); + return this; + } + + private boolean includeCitations_; + /** + * + * + *
+         * Specifies whether to include citations in the summary. The default
+         * value is `false`.
+         *
+         * When this field is set to `true`, summaries include in-line citation
+         * numbers.
+         *
+         * Example summary including citations:
+         *
+         * BigQuery is Google Cloud's fully managed and completely serverless
+         * enterprise data warehouse [1]. BigQuery supports all data types, works
+         * across clouds, and has built-in machine learning and business
+         * intelligence, all within a unified platform [2, 3].
+         *
+         * The citation numbers refer to the returned search results and are
+         * 1-indexed. For example, [1] means that the sentence is attributed to
+         * the first search result. [2, 3] means that the sentence is attributed
+         * to both the second and third search results.
+         * 
+ * + * bool include_citations = 2; + * + * @return The includeCitations. + */ + @java.lang.Override + public boolean getIncludeCitations() { + return includeCitations_; + } + /** + * + * + *
+         * Specifies whether to include citations in the summary. The default
+         * value is `false`.
+         *
+         * When this field is set to `true`, summaries include in-line citation
+         * numbers.
+         *
+         * Example summary including citations:
+         *
+         * BigQuery is Google Cloud's fully managed and completely serverless
+         * enterprise data warehouse [1]. BigQuery supports all data types, works
+         * across clouds, and has built-in machine learning and business
+         * intelligence, all within a unified platform [2, 3].
+         *
+         * The citation numbers refer to the returned search results and are
+         * 1-indexed. For example, [1] means that the sentence is attributed to
+         * the first search result. [2, 3] means that the sentence is attributed
+         * to both the second and third search results.
+         * 
+ * + * bool include_citations = 2; + * + * @param value The includeCitations to set. + * @return This builder for chaining. + */ + public Builder setIncludeCitations(boolean value) { + + includeCitations_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * Specifies whether to include citations in the summary. The default
+         * value is `false`.
+         *
+         * When this field is set to `true`, summaries include in-line citation
+         * numbers.
+         *
+         * Example summary including citations:
+         *
+         * BigQuery is Google Cloud's fully managed and completely serverless
+         * enterprise data warehouse [1]. BigQuery supports all data types, works
+         * across clouds, and has built-in machine learning and business
+         * intelligence, all within a unified platform [2, 3].
+         *
+         * The citation numbers refer to the returned search results and are
+         * 1-indexed. For example, [1] means that the sentence is attributed to
+         * the first search result. [2, 3] means that the sentence is attributed
+         * to both the second and third search results.
+         * 
+ * + * bool include_citations = 2; + * + * @return This builder for chaining. + */ + public Builder clearIncludeCitations() { + bitField0_ = (bitField0_ & ~0x00000002); + includeCitations_ = false; + onChanged(); + return this; + } + + private boolean ignoreAdversarialQuery_; + /** + * + * + *
+         * Specifies whether to filter out adversarial queries. The default value
+         * is `false`.
+         *
+         * Google employs search-query classification to detect adversarial
+         * queries. No summary is returned if the search query is classified as an
+         * adversarial query. For example, a user might ask a question regarding
+         * negative comments about the company or submit a query designed to
+         * generate unsafe, policy-violating output. If this field is set to
+         * `true`, we skip generating summaries for adversarial queries and return
+         * fallback messages instead.
+         * 
+ * + * bool ignore_adversarial_query = 3; + * + * @return The ignoreAdversarialQuery. + */ + @java.lang.Override + public boolean getIgnoreAdversarialQuery() { + return ignoreAdversarialQuery_; + } + /** + * + * + *
+         * Specifies whether to filter out adversarial queries. The default value
+         * is `false`.
+         *
+         * Google employs search-query classification to detect adversarial
+         * queries. No summary is returned if the search query is classified as an
+         * adversarial query. For example, a user might ask a question regarding
+         * negative comments about the company or submit a query designed to
+         * generate unsafe, policy-violating output. If this field is set to
+         * `true`, we skip generating summaries for adversarial queries and return
+         * fallback messages instead.
+         * 
+ * + * bool ignore_adversarial_query = 3; + * + * @param value The ignoreAdversarialQuery to set. + * @return This builder for chaining. + */ + public Builder setIgnoreAdversarialQuery(boolean value) { + + ignoreAdversarialQuery_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+         * Specifies whether to filter out adversarial queries. The default value
+         * is `false`.
+         *
+         * Google employs search-query classification to detect adversarial
+         * queries. No summary is returned if the search query is classified as an
+         * adversarial query. For example, a user might ask a question regarding
+         * negative comments about the company or submit a query designed to
+         * generate unsafe, policy-violating output. If this field is set to
+         * `true`, we skip generating summaries for adversarial queries and return
+         * fallback messages instead.
+         * 
+ * + * bool ignore_adversarial_query = 3; + * + * @return This builder for chaining. + */ + public Builder clearIgnoreAdversarialQuery() { + bitField0_ = (bitField0_ & ~0x00000004); + ignoreAdversarialQuery_ = false; + onChanged(); + return this; + } + + private boolean ignoreNonSummarySeekingQuery_; + /** + * + * + *
+         * Specifies whether to filter out queries that are not summary-seeking.
+         * The default value is `false`.
+         *
+         * Google employs search-query classification to detect summary-seeking
+         * queries. No summary is returned if the search query is classified as a
+         * non-summary seeking query. For example, `why is the sky blue` and `Who
+         * is the best soccer player in the world?` are summary-seeking queries,
+         * but `SFO airport` and `world cup 2026` are not. They are most likely
+         * navigational queries. If this field is set to `true`, we skip
+         * generating summaries for non-summary seeking queries and return
+         * fallback messages instead.
+         * 
+ * + * bool ignore_non_summary_seeking_query = 4; + * + * @return The ignoreNonSummarySeekingQuery. + */ + @java.lang.Override + public boolean getIgnoreNonSummarySeekingQuery() { + return ignoreNonSummarySeekingQuery_; + } + /** + * + * + *
+         * Specifies whether to filter out queries that are not summary-seeking.
+         * The default value is `false`.
+         *
+         * Google employs search-query classification to detect summary-seeking
+         * queries. No summary is returned if the search query is classified as a
+         * non-summary seeking query. For example, `why is the sky blue` and `Who
+         * is the best soccer player in the world?` are summary-seeking queries,
+         * but `SFO airport` and `world cup 2026` are not. They are most likely
+         * navigational queries. If this field is set to `true`, we skip
+         * generating summaries for non-summary seeking queries and return
+         * fallback messages instead.
+         * 
+ * + * bool ignore_non_summary_seeking_query = 4; + * + * @param value The ignoreNonSummarySeekingQuery to set. + * @return This builder for chaining. + */ + public Builder setIgnoreNonSummarySeekingQuery(boolean value) { + + ignoreNonSummarySeekingQuery_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+         * Specifies whether to filter out queries that are not summary-seeking.
+         * The default value is `false`.
+         *
+         * Google employs search-query classification to detect summary-seeking
+         * queries. No summary is returned if the search query is classified as a
+         * non-summary seeking query. For example, `why is the sky blue` and `Who
+         * is the best soccer player in the world?` are summary-seeking queries,
+         * but `SFO airport` and `world cup 2026` are not. They are most likely
+         * navigational queries. If this field is set to `true`, we skip
+         * generating summaries for non-summary seeking queries and return
+         * fallback messages instead.
+         * 
+ * + * bool ignore_non_summary_seeking_query = 4; + * + * @return This builder for chaining. + */ + public Builder clearIgnoreNonSummarySeekingQuery() { + bitField0_ = (bitField0_ & ~0x00000008); + ignoreNonSummarySeekingQuery_ = false; + onChanged(); + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+         * Language code for Summary. Use language tags defined by
+         * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+         * Note: This is an experimental feature.
+         * 
+ * + * string language_code = 6; + * + * @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 code for Summary. Use language tags defined by
+         * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+         * Note: This is an experimental feature.
+         * 
+ * + * string language_code = 6; + * + * @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 code for Summary. Use language tags defined by
+         * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+         * Note: This is an experimental feature.
+         * 
+ * + * string language_code = 6; + * + * @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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+         * Language code for Summary. Use language tags defined by
+         * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+         * Note: This is an experimental feature.
+         * 
+ * + * string language_code = 6; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + languageCode_ = getDefaultInstance().getLanguageCode(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+         * Language code for Summary. Use language tags defined by
+         * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
+         * Note: This is an experimental feature.
+         * 
+ * + * string language_code = 6; + * + * @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; + bitField0_ |= 0x00000010; + 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.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec) + private static final com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec(); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SummarySpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ExtractiveContentSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The maximum number of extractive answers returned in each search
+       * result.
+       *
+       * An extractive answer is a verbatim answer extracted from the original
+       * document, which provides a precise and contextually relevant answer to
+       * the search query.
+       *
+       * If the number of matching answers is less than the
+       * `max_extractive_answer_count`, return all of the answers. Otherwise,
+       * return the `max_extractive_answer_count`.
+       *
+       * At most one answer is returned for each
+       * [SearchResult][google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult].
+       * 
+ * + * int32 max_extractive_answer_count = 1; + * + * @return The maxExtractiveAnswerCount. + */ + int getMaxExtractiveAnswerCount(); + + /** + * + * + *
+       * The max number of extractive segments returned in each search result.
+       * Only applied if the
+       * [DataStore][google.cloud.discoveryengine.v1alpha.DataStore] is set to
+       * [DataStore.ContentConfig.CONTENT_REQUIRED][google.cloud.discoveryengine.v1alpha.DataStore.ContentConfig.CONTENT_REQUIRED]
+       * or
+       * [DataStore.solution_types][google.cloud.discoveryengine.v1alpha.DataStore.solution_types]
+       * is
+       * [SOLUTION_TYPE_CHAT][google.cloud.discoveryengine.v1alpha.SolutionType.SOLUTION_TYPE_CHAT].
+       *
+       * An extractive segment is a text segment extracted from the original
+       * document that is relevant to the search query, and, in general, more
+       * verbose than an extractive answer. The segment could then be used as
+       * input for LLMs to generate summaries and answers.
+       *
+       * If the number of matching segments is less than
+       * `max_extractive_segment_count`, return all of the segments. Otherwise,
+       * return the `max_extractive_segment_count`.
+       * 
+ * + * int32 max_extractive_segment_count = 2; + * + * @return The maxExtractiveSegmentCount. + */ + int getMaxExtractiveSegmentCount(); + + /** + * + * + *
+       * Specifies whether to return the confidence score from the extractive
+       * segments in each search result. The default value is `false`.
+       *
+       * Note: this is a priavte preview feature and only works for allowlisted
+       * users, please reach out to Cloud Support team if you want to use it.
+       * 
+ * + * bool return_extractive_segment_score = 3; + * + * @return The returnExtractiveSegmentScore. + */ + boolean getReturnExtractiveSegmentScore(); + + /** + * + * + *
+       * Specifies whether to also include the adjacent from each selected
+       * segments.
+       * Return at most `num_previous_segments` segments before each selected
+       * segments.
+       * 
+ * + * int32 num_previous_segments = 4; + * + * @return The numPreviousSegments. + */ + int getNumPreviousSegments(); + + /** + * + * + *
+       * Return at most `num_next_segments` segments after each selected
+       * segments.
+       * 
+ * + * int32 num_next_segments = 5; + * + * @return The numNextSegments. + */ + int getNumNextSegments(); + } + /** + * + * + *
+     * A specification for configuring the extractive content in a search
+     * response.
+     * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec} + */ + public static final class ExtractiveContentSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec) + ExtractiveContentSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExtractiveContentSpec.newBuilder() to construct. + private ExtractiveContentSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExtractiveContentSpec() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExtractiveContentSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_ExtractiveContentSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_ExtractiveContentSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec.Builder.class); + } + + public static final int MAX_EXTRACTIVE_ANSWER_COUNT_FIELD_NUMBER = 1; + private int maxExtractiveAnswerCount_ = 0; + /** + * + * + *
+       * The maximum number of extractive answers returned in each search
+       * result.
+       *
+       * An extractive answer is a verbatim answer extracted from the original
+       * document, which provides a precise and contextually relevant answer to
+       * the search query.
+       *
+       * If the number of matching answers is less than the
+       * `max_extractive_answer_count`, return all of the answers. Otherwise,
+       * return the `max_extractive_answer_count`.
+       *
+       * At most one answer is returned for each
+       * [SearchResult][google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult].
+       * 
+ * + * int32 max_extractive_answer_count = 1; + * + * @return The maxExtractiveAnswerCount. + */ + @java.lang.Override + public int getMaxExtractiveAnswerCount() { + return maxExtractiveAnswerCount_; + } + + public static final int MAX_EXTRACTIVE_SEGMENT_COUNT_FIELD_NUMBER = 2; + private int maxExtractiveSegmentCount_ = 0; + /** + * + * + *
+       * The max number of extractive segments returned in each search result.
+       * Only applied if the
+       * [DataStore][google.cloud.discoveryengine.v1alpha.DataStore] is set to
+       * [DataStore.ContentConfig.CONTENT_REQUIRED][google.cloud.discoveryengine.v1alpha.DataStore.ContentConfig.CONTENT_REQUIRED]
+       * or
+       * [DataStore.solution_types][google.cloud.discoveryengine.v1alpha.DataStore.solution_types]
+       * is
+       * [SOLUTION_TYPE_CHAT][google.cloud.discoveryengine.v1alpha.SolutionType.SOLUTION_TYPE_CHAT].
+       *
+       * An extractive segment is a text segment extracted from the original
+       * document that is relevant to the search query, and, in general, more
+       * verbose than an extractive answer. The segment could then be used as
+       * input for LLMs to generate summaries and answers.
+       *
+       * If the number of matching segments is less than
+       * `max_extractive_segment_count`, return all of the segments. Otherwise,
+       * return the `max_extractive_segment_count`.
+       * 
+ * + * int32 max_extractive_segment_count = 2; + * + * @return The maxExtractiveSegmentCount. + */ + @java.lang.Override + public int getMaxExtractiveSegmentCount() { + return maxExtractiveSegmentCount_; + } + + public static final int RETURN_EXTRACTIVE_SEGMENT_SCORE_FIELD_NUMBER = 3; + private boolean returnExtractiveSegmentScore_ = false; + /** + * + * + *
+       * Specifies whether to return the confidence score from the extractive
+       * segments in each search result. The default value is `false`.
+       *
+       * Note: this is a priavte preview feature and only works for allowlisted
+       * users, please reach out to Cloud Support team if you want to use it.
+       * 
+ * + * bool return_extractive_segment_score = 3; + * + * @return The returnExtractiveSegmentScore. + */ + @java.lang.Override + public boolean getReturnExtractiveSegmentScore() { + return returnExtractiveSegmentScore_; + } + + public static final int NUM_PREVIOUS_SEGMENTS_FIELD_NUMBER = 4; + private int numPreviousSegments_ = 0; + /** + * + * + *
+       * Specifies whether to also include the adjacent from each selected
+       * segments.
+       * Return at most `num_previous_segments` segments before each selected
+       * segments.
+       * 
+ * + * int32 num_previous_segments = 4; + * + * @return The numPreviousSegments. + */ + @java.lang.Override + public int getNumPreviousSegments() { + return numPreviousSegments_; + } + + public static final int NUM_NEXT_SEGMENTS_FIELD_NUMBER = 5; + private int numNextSegments_ = 0; + /** + * + * + *
+       * Return at most `num_next_segments` segments after each selected
+       * segments.
+       * 
+ * + * int32 num_next_segments = 5; + * + * @return The numNextSegments. + */ + @java.lang.Override + public int getNumNextSegments() { + return numNextSegments_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (maxExtractiveAnswerCount_ != 0) { + output.writeInt32(1, maxExtractiveAnswerCount_); + } + if (maxExtractiveSegmentCount_ != 0) { + output.writeInt32(2, maxExtractiveSegmentCount_); + } + if (returnExtractiveSegmentScore_ != false) { + output.writeBool(3, returnExtractiveSegmentScore_); + } + if (numPreviousSegments_ != 0) { + output.writeInt32(4, numPreviousSegments_); + } + if (numNextSegments_ != 0) { + output.writeInt32(5, numNextSegments_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (maxExtractiveAnswerCount_ != 0) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size(1, maxExtractiveAnswerCount_); + } + if (maxExtractiveSegmentCount_ != 0) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size(2, maxExtractiveSegmentCount_); + } + if (returnExtractiveSegmentScore_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 3, returnExtractiveSegmentScore_); + } + if (numPreviousSegments_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, numPreviousSegments_); + } + if (numNextSegments_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, numNextSegments_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + other = + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec) + obj; + + if (getMaxExtractiveAnswerCount() != other.getMaxExtractiveAnswerCount()) return false; + if (getMaxExtractiveSegmentCount() != other.getMaxExtractiveSegmentCount()) return false; + if (getReturnExtractiveSegmentScore() != other.getReturnExtractiveSegmentScore()) + return false; + if (getNumPreviousSegments() != other.getNumPreviousSegments()) return false; + if (getNumNextSegments() != other.getNumNextSegments()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MAX_EXTRACTIVE_ANSWER_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMaxExtractiveAnswerCount(); + hash = (37 * hash) + MAX_EXTRACTIVE_SEGMENT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMaxExtractiveSegmentCount(); + hash = (37 * hash) + RETURN_EXTRACTIVE_SEGMENT_SCORE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashBoolean(getReturnExtractiveSegmentScore()); + hash = (37 * hash) + NUM_PREVIOUS_SEGMENTS_FIELD_NUMBER; + hash = (53 * hash) + getNumPreviousSegments(); + hash = (37 * hash) + NUM_NEXT_SEGMENTS_FIELD_NUMBER; + hash = (53 * hash) + getNumNextSegments(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 specification for configuring the extractive content in a search
+       * response.
+       * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec) + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_ExtractiveContentSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_ExtractiveContentSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + maxExtractiveAnswerCount_ = 0; + maxExtractiveSegmentCount_ = 0; + returnExtractiveSegmentScore_ = false; + numPreviousSegments_ = 0; + numNextSegments_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_ExtractiveContentSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + build() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + result = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.maxExtractiveAnswerCount_ = maxExtractiveAnswerCount_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxExtractiveSegmentCount_ = maxExtractiveSegmentCount_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.returnExtractiveSegmentScore_ = returnExtractiveSegmentScore_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.numPreviousSegments_ = numPreviousSegments_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.numNextSegments_ = numNextSegments_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec.getDefaultInstance()) return this; + if (other.getMaxExtractiveAnswerCount() != 0) { + setMaxExtractiveAnswerCount(other.getMaxExtractiveAnswerCount()); + } + if (other.getMaxExtractiveSegmentCount() != 0) { + setMaxExtractiveSegmentCount(other.getMaxExtractiveSegmentCount()); + } + if (other.getReturnExtractiveSegmentScore() != false) { + setReturnExtractiveSegmentScore(other.getReturnExtractiveSegmentScore()); + } + if (other.getNumPreviousSegments() != 0) { + setNumPreviousSegments(other.getNumPreviousSegments()); + } + if (other.getNumNextSegments() != 0) { + setNumNextSegments(other.getNumNextSegments()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + maxExtractiveAnswerCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + maxExtractiveSegmentCount_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + returnExtractiveSegmentScore_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + numPreviousSegments_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + numNextSegments_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int maxExtractiveAnswerCount_; + /** + * + * + *
+         * The maximum number of extractive answers returned in each search
+         * result.
+         *
+         * An extractive answer is a verbatim answer extracted from the original
+         * document, which provides a precise and contextually relevant answer to
+         * the search query.
+         *
+         * If the number of matching answers is less than the
+         * `max_extractive_answer_count`, return all of the answers. Otherwise,
+         * return the `max_extractive_answer_count`.
+         *
+         * At most one answer is returned for each
+         * [SearchResult][google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult].
+         * 
+ * + * int32 max_extractive_answer_count = 1; + * + * @return The maxExtractiveAnswerCount. + */ + @java.lang.Override + public int getMaxExtractiveAnswerCount() { + return maxExtractiveAnswerCount_; + } + /** + * + * + *
+         * The maximum number of extractive answers returned in each search
+         * result.
+         *
+         * An extractive answer is a verbatim answer extracted from the original
+         * document, which provides a precise and contextually relevant answer to
+         * the search query.
+         *
+         * If the number of matching answers is less than the
+         * `max_extractive_answer_count`, return all of the answers. Otherwise,
+         * return the `max_extractive_answer_count`.
+         *
+         * At most one answer is returned for each
+         * [SearchResult][google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult].
+         * 
+ * + * int32 max_extractive_answer_count = 1; + * + * @param value The maxExtractiveAnswerCount to set. + * @return This builder for chaining. + */ + public Builder setMaxExtractiveAnswerCount(int value) { + + maxExtractiveAnswerCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The maximum number of extractive answers returned in each search
+         * result.
+         *
+         * An extractive answer is a verbatim answer extracted from the original
+         * document, which provides a precise and contextually relevant answer to
+         * the search query.
+         *
+         * If the number of matching answers is less than the
+         * `max_extractive_answer_count`, return all of the answers. Otherwise,
+         * return the `max_extractive_answer_count`.
+         *
+         * At most one answer is returned for each
+         * [SearchResult][google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult].
+         * 
+ * + * int32 max_extractive_answer_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearMaxExtractiveAnswerCount() { + bitField0_ = (bitField0_ & ~0x00000001); + maxExtractiveAnswerCount_ = 0; + onChanged(); + return this; + } + + private int maxExtractiveSegmentCount_; + /** + * + * + *
+         * The max number of extractive segments returned in each search result.
+         * Only applied if the
+         * [DataStore][google.cloud.discoveryengine.v1alpha.DataStore] is set to
+         * [DataStore.ContentConfig.CONTENT_REQUIRED][google.cloud.discoveryengine.v1alpha.DataStore.ContentConfig.CONTENT_REQUIRED]
+         * or
+         * [DataStore.solution_types][google.cloud.discoveryengine.v1alpha.DataStore.solution_types]
+         * is
+         * [SOLUTION_TYPE_CHAT][google.cloud.discoveryengine.v1alpha.SolutionType.SOLUTION_TYPE_CHAT].
+         *
+         * An extractive segment is a text segment extracted from the original
+         * document that is relevant to the search query, and, in general, more
+         * verbose than an extractive answer. The segment could then be used as
+         * input for LLMs to generate summaries and answers.
+         *
+         * If the number of matching segments is less than
+         * `max_extractive_segment_count`, return all of the segments. Otherwise,
+         * return the `max_extractive_segment_count`.
+         * 
+ * + * int32 max_extractive_segment_count = 2; + * + * @return The maxExtractiveSegmentCount. + */ + @java.lang.Override + public int getMaxExtractiveSegmentCount() { + return maxExtractiveSegmentCount_; + } + /** + * + * + *
+         * The max number of extractive segments returned in each search result.
+         * Only applied if the
+         * [DataStore][google.cloud.discoveryengine.v1alpha.DataStore] is set to
+         * [DataStore.ContentConfig.CONTENT_REQUIRED][google.cloud.discoveryengine.v1alpha.DataStore.ContentConfig.CONTENT_REQUIRED]
+         * or
+         * [DataStore.solution_types][google.cloud.discoveryengine.v1alpha.DataStore.solution_types]
+         * is
+         * [SOLUTION_TYPE_CHAT][google.cloud.discoveryengine.v1alpha.SolutionType.SOLUTION_TYPE_CHAT].
+         *
+         * An extractive segment is a text segment extracted from the original
+         * document that is relevant to the search query, and, in general, more
+         * verbose than an extractive answer. The segment could then be used as
+         * input for LLMs to generate summaries and answers.
+         *
+         * If the number of matching segments is less than
+         * `max_extractive_segment_count`, return all of the segments. Otherwise,
+         * return the `max_extractive_segment_count`.
+         * 
+ * + * int32 max_extractive_segment_count = 2; + * + * @param value The maxExtractiveSegmentCount to set. + * @return This builder for chaining. + */ + public Builder setMaxExtractiveSegmentCount(int value) { + + maxExtractiveSegmentCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * The max number of extractive segments returned in each search result.
+         * Only applied if the
+         * [DataStore][google.cloud.discoveryengine.v1alpha.DataStore] is set to
+         * [DataStore.ContentConfig.CONTENT_REQUIRED][google.cloud.discoveryengine.v1alpha.DataStore.ContentConfig.CONTENT_REQUIRED]
+         * or
+         * [DataStore.solution_types][google.cloud.discoveryengine.v1alpha.DataStore.solution_types]
+         * is
+         * [SOLUTION_TYPE_CHAT][google.cloud.discoveryengine.v1alpha.SolutionType.SOLUTION_TYPE_CHAT].
+         *
+         * An extractive segment is a text segment extracted from the original
+         * document that is relevant to the search query, and, in general, more
+         * verbose than an extractive answer. The segment could then be used as
+         * input for LLMs to generate summaries and answers.
+         *
+         * If the number of matching segments is less than
+         * `max_extractive_segment_count`, return all of the segments. Otherwise,
+         * return the `max_extractive_segment_count`.
+         * 
+ * + * int32 max_extractive_segment_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearMaxExtractiveSegmentCount() { + bitField0_ = (bitField0_ & ~0x00000002); + maxExtractiveSegmentCount_ = 0; + onChanged(); + return this; + } + + private boolean returnExtractiveSegmentScore_; + /** + * + * + *
+         * Specifies whether to return the confidence score from the extractive
+         * segments in each search result. The default value is `false`.
+         *
+         * Note: this is a priavte preview feature and only works for allowlisted
+         * users, please reach out to Cloud Support team if you want to use it.
+         * 
+ * + * bool return_extractive_segment_score = 3; + * + * @return The returnExtractiveSegmentScore. + */ + @java.lang.Override + public boolean getReturnExtractiveSegmentScore() { + return returnExtractiveSegmentScore_; + } + /** + * + * + *
+         * Specifies whether to return the confidence score from the extractive
+         * segments in each search result. The default value is `false`.
+         *
+         * Note: this is a priavte preview feature and only works for allowlisted
+         * users, please reach out to Cloud Support team if you want to use it.
+         * 
+ * + * bool return_extractive_segment_score = 3; + * + * @param value The returnExtractiveSegmentScore to set. + * @return This builder for chaining. + */ + public Builder setReturnExtractiveSegmentScore(boolean value) { + + returnExtractiveSegmentScore_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+         * Specifies whether to return the confidence score from the extractive
+         * segments in each search result. The default value is `false`.
+         *
+         * Note: this is a priavte preview feature and only works for allowlisted
+         * users, please reach out to Cloud Support team if you want to use it.
+         * 
+ * + * bool return_extractive_segment_score = 3; + * + * @return This builder for chaining. + */ + public Builder clearReturnExtractiveSegmentScore() { + bitField0_ = (bitField0_ & ~0x00000004); + returnExtractiveSegmentScore_ = false; + onChanged(); + return this; + } + + private int numPreviousSegments_; + /** + * + * + *
+         * Specifies whether to also include the adjacent from each selected
+         * segments.
+         * Return at most `num_previous_segments` segments before each selected
+         * segments.
+         * 
+ * + * int32 num_previous_segments = 4; + * + * @return The numPreviousSegments. + */ + @java.lang.Override + public int getNumPreviousSegments() { + return numPreviousSegments_; + } + /** + * + * + *
+         * Specifies whether to also include the adjacent from each selected
+         * segments.
+         * Return at most `num_previous_segments` segments before each selected
+         * segments.
+         * 
+ * + * int32 num_previous_segments = 4; + * + * @param value The numPreviousSegments to set. + * @return This builder for chaining. + */ + public Builder setNumPreviousSegments(int value) { + + numPreviousSegments_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+         * Specifies whether to also include the adjacent from each selected
+         * segments.
+         * Return at most `num_previous_segments` segments before each selected
+         * segments.
+         * 
+ * + * int32 num_previous_segments = 4; + * + * @return This builder for chaining. + */ + public Builder clearNumPreviousSegments() { + bitField0_ = (bitField0_ & ~0x00000008); + numPreviousSegments_ = 0; + onChanged(); + return this; + } + + private int numNextSegments_; + /** + * + * + *
+         * Return at most `num_next_segments` segments after each selected
+         * segments.
+         * 
+ * + * int32 num_next_segments = 5; + * + * @return The numNextSegments. + */ + @java.lang.Override + public int getNumNextSegments() { + return numNextSegments_; + } + /** + * + * + *
+         * Return at most `num_next_segments` segments after each selected
+         * segments.
+         * 
+ * + * int32 num_next_segments = 5; + * + * @param value The numNextSegments to set. + * @return This builder for chaining. + */ + public Builder setNumNextSegments(int value) { + + numNextSegments_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+         * Return at most `num_next_segments` segments after each selected
+         * segments.
+         * 
+ * + * int32 num_next_segments = 5; + * + * @return This builder for chaining. + */ + public Builder clearNumNextSegments() { + bitField0_ = (bitField0_ & ~0x00000010); + numNextSegments_ = 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.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec) + private static final com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec(); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExtractiveContentSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int SNIPPET_SPEC_FIELD_NUMBER = 1; + private com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + snippetSpec_; + /** + * + * + *
+     * If `snippetSpec` is not specified, snippets are not included in the
+     * search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; + * + * + * @return Whether the snippetSpec field is set. + */ + @java.lang.Override + public boolean hasSnippetSpec() { + return snippetSpec_ != null; + } + /** + * + * + *
+     * If `snippetSpec` is not specified, snippets are not included in the
+     * search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; + * + * + * @return The snippetSpec. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + getSnippetSpec() { + return snippetSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + .getDefaultInstance() + : snippetSpec_; + } + /** + * + * + *
+     * If `snippetSpec` is not specified, snippets are not included in the
+     * search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpecOrBuilder + getSnippetSpecOrBuilder() { + return snippetSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + .getDefaultInstance() + : snippetSpec_; + } + + public static final int SUMMARY_SPEC_FIELD_NUMBER = 2; + private com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + summarySpec_; + /** + * + * + *
+     * If `summarySpec` is not specified, summaries are not included in the
+     * search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + * + * @return Whether the summarySpec field is set. + */ + @java.lang.Override + public boolean hasSummarySpec() { + return summarySpec_ != null; + } + /** + * + * + *
+     * If `summarySpec` is not specified, summaries are not included in the
+     * search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + * + * @return The summarySpec. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + getSummarySpec() { + return summarySpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance() + : summarySpec_; + } + /** + * + * + *
+     * If `summarySpec` is not specified, summaries are not included in the
+     * search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpecOrBuilder + getSummarySpecOrBuilder() { + return summarySpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance() + : summarySpec_; + } + + public static final int EXTRACTIVE_CONTENT_SPEC_FIELD_NUMBER = 3; + private com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + extractiveContentSpec_; + /** + * + * + *
+     * If there is no extractive_content_spec provided, there will be no
+     * extractive answer in the search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec extractive_content_spec = 3; + * + * + * @return Whether the extractiveContentSpec field is set. + */ + @java.lang.Override + public boolean hasExtractiveContentSpec() { + return extractiveContentSpec_ != null; + } + /** + * + * + *
+     * If there is no extractive_content_spec provided, there will be no
+     * extractive answer in the search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec extractive_content_spec = 3; + * + * + * @return The extractiveContentSpec. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + getExtractiveContentSpec() { + return extractiveContentSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec.getDefaultInstance() + : extractiveContentSpec_; + } + /** + * + * + *
+     * If there is no extractive_content_spec provided, there will be no
+     * extractive answer in the search response.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec extractive_content_spec = 3; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpecOrBuilder + getExtractiveContentSpecOrBuilder() { + return extractiveContentSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec.getDefaultInstance() + : extractiveContentSpec_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (snippetSpec_ != null) { + output.writeMessage(1, getSnippetSpec()); + } + if (summarySpec_ != null) { + output.writeMessage(2, getSummarySpec()); + } + if (extractiveContentSpec_ != null) { + output.writeMessage(3, getExtractiveContentSpec()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (snippetSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSnippetSpec()); + } + if (summarySpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSummarySpec()); + } + if (extractiveContentSpec_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getExtractiveContentSpec()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec other = + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec) obj; + + if (hasSnippetSpec() != other.hasSnippetSpec()) return false; + if (hasSnippetSpec()) { + if (!getSnippetSpec().equals(other.getSnippetSpec())) return false; + } + if (hasSummarySpec() != other.hasSummarySpec()) return false; + if (hasSummarySpec()) { + if (!getSummarySpec().equals(other.getSummarySpec())) return false; + } + if (hasExtractiveContentSpec() != other.hasExtractiveContentSpec()) return false; + if (hasExtractiveContentSpec()) { + if (!getExtractiveContentSpec().equals(other.getExtractiveContentSpec())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSnippetSpec()) { + hash = (37 * hash) + SNIPPET_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getSnippetSpec().hashCode(); + } + if (hasSummarySpec()) { + hash = (37 * hash) + SUMMARY_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getSummarySpec().hashCode(); + } + if (hasExtractiveContentSpec()) { + hash = (37 * hash) + EXTRACTIVE_CONTENT_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getExtractiveContentSpec().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 specification for configuring the behavior of content search.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec) + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.Builder + .class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + snippetSpec_ = null; + if (snippetSpecBuilder_ != null) { + snippetSpecBuilder_.dispose(); + snippetSpecBuilder_ = null; + } + summarySpec_ = null; + if (summarySpecBuilder_ != null) { + summarySpecBuilder_.dispose(); + summarySpecBuilder_ = null; + } + extractiveContentSpec_ = null; + if (extractiveContentSpecBuilder_ != null) { + extractiveContentSpecBuilder_.dispose(); + extractiveContentSpecBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec build() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec result = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.snippetSpec_ = + snippetSpecBuilder_ == null ? snippetSpec_ : snippetSpecBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.summarySpec_ = + summarySpecBuilder_ == null ? summarySpec_ : summarySpecBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.extractiveContentSpec_ = + extractiveContentSpecBuilder_ == null + ? extractiveContentSpec_ + : extractiveContentSpecBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .getDefaultInstance()) return this; + if (other.hasSnippetSpec()) { + mergeSnippetSpec(other.getSnippetSpec()); + } + if (other.hasSummarySpec()) { + mergeSummarySpec(other.getSummarySpec()); + } + if (other.hasExtractiveContentSpec()) { + mergeExtractiveContentSpec(other.getExtractiveContentSpec()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getSnippetSpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getSummarySpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + getExtractiveContentSpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + snippetSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + .Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpecOrBuilder> + snippetSpecBuilder_; + /** + * + * + *
+       * If `snippetSpec` is not specified, snippets are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; + * + * + * @return Whether the snippetSpec field is set. + */ + public boolean hasSnippetSpec() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * If `snippetSpec` is not specified, snippets are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; + * + * + * @return The snippetSpec. + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + getSnippetSpec() { + if (snippetSpecBuilder_ == null) { + return snippetSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + .getDefaultInstance() + : snippetSpec_; + } else { + return snippetSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+       * If `snippetSpec` is not specified, snippets are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; + * + */ + public Builder setSnippetSpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + value) { + if (snippetSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + snippetSpec_ = value; + } else { + snippetSpecBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * If `snippetSpec` is not specified, snippets are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; + * + */ + public Builder setSnippetSpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + .Builder + builderForValue) { + if (snippetSpecBuilder_ == null) { + snippetSpec_ = builderForValue.build(); + } else { + snippetSpecBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * If `snippetSpec` is not specified, snippets are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; + * + */ + public Builder mergeSnippetSpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + value) { + if (snippetSpecBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && snippetSpec_ != null + && snippetSpec_ + != com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec.getDefaultInstance()) { + getSnippetSpecBuilder().mergeFrom(value); + } else { + snippetSpec_ = value; + } + } else { + snippetSpecBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * If `snippetSpec` is not specified, snippets are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; + * + */ + public Builder clearSnippetSpec() { + bitField0_ = (bitField0_ & ~0x00000001); + snippetSpec_ = null; + if (snippetSpecBuilder_ != null) { + snippetSpecBuilder_.dispose(); + snippetSpecBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * If `snippetSpec` is not specified, snippets are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + .Builder + getSnippetSpecBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getSnippetSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * If `snippetSpec` is not specified, snippets are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpecOrBuilder + getSnippetSpecOrBuilder() { + if (snippetSpecBuilder_ != null) { + return snippetSpecBuilder_.getMessageOrBuilder(); + } else { + return snippetSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + .getDefaultInstance() + : snippetSpec_; + } + } + /** + * + * + *
+       * If `snippetSpec` is not specified, snippets are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec snippet_spec = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec + .Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpecOrBuilder> + getSnippetSpecFieldBuilder() { + if (snippetSpecBuilder_ == null) { + snippetSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SnippetSpecOrBuilder>(getSnippetSpec(), getParentForChildren(), isClean()); + snippetSpec_ = null; + } + return snippetSpecBuilder_; + } + + private com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + summarySpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + .Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpecOrBuilder> + summarySpecBuilder_; + /** + * + * + *
+       * If `summarySpec` is not specified, summaries are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + * + * @return Whether the summarySpec field is set. + */ + public boolean hasSummarySpec() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * If `summarySpec` is not specified, summaries are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + * + * @return The summarySpec. + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + getSummarySpec() { + if (summarySpecBuilder_ == null) { + return summarySpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance() + : summarySpec_; + } else { + return summarySpecBuilder_.getMessage(); + } + } + /** + * + * + *
+       * If `summarySpec` is not specified, summaries are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + */ + public Builder setSummarySpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + value) { + if (summarySpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + summarySpec_ = value; + } else { + summarySpecBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * If `summarySpec` is not specified, summaries are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + */ + public Builder setSummarySpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + .Builder + builderForValue) { + if (summarySpecBuilder_ == null) { + summarySpec_ = builderForValue.build(); + } else { + summarySpecBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * If `summarySpec` is not specified, summaries are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + */ + public Builder mergeSummarySpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + value) { + if (summarySpecBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && summarySpec_ != null + && summarySpec_ + != com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec.getDefaultInstance()) { + getSummarySpecBuilder().mergeFrom(value); + } else { + summarySpec_ = value; + } + } else { + summarySpecBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * If `summarySpec` is not specified, summaries are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + */ + public Builder clearSummarySpec() { + bitField0_ = (bitField0_ & ~0x00000002); + summarySpec_ = null; + if (summarySpecBuilder_ != null) { + summarySpecBuilder_.dispose(); + summarySpecBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * If `summarySpec` is not specified, summaries are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + .Builder + getSummarySpecBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getSummarySpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * If `summarySpec` is not specified, summaries are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpecOrBuilder + getSummarySpecOrBuilder() { + if (summarySpecBuilder_ != null) { + return summarySpecBuilder_.getMessageOrBuilder(); + } else { + return summarySpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + .getDefaultInstance() + : summarySpec_; + } + } + /** + * + * + *
+       * If `summarySpec` is not specified, summaries are not included in the
+       * search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + .Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpecOrBuilder> + getSummarySpecFieldBuilder() { + if (summarySpecBuilder_ == null) { + summarySpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .SummarySpecOrBuilder>(getSummarySpec(), getParentForChildren(), isClean()); + summarySpec_ = null; + } + return summarySpecBuilder_; + } + + private com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + extractiveContentSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpecOrBuilder> + extractiveContentSpecBuilder_; + /** + * + * + *
+       * If there is no extractive_content_spec provided, there will be no
+       * extractive answer in the search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec extractive_content_spec = 3; + * + * + * @return Whether the extractiveContentSpec field is set. + */ + public boolean hasExtractiveContentSpec() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+       * If there is no extractive_content_spec provided, there will be no
+       * extractive answer in the search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec extractive_content_spec = 3; + * + * + * @return The extractiveContentSpec. + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + getExtractiveContentSpec() { + if (extractiveContentSpecBuilder_ == null) { + return extractiveContentSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec.getDefaultInstance() + : extractiveContentSpec_; + } else { + return extractiveContentSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+       * If there is no extractive_content_spec provided, there will be no
+       * extractive answer in the search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec extractive_content_spec = 3; + * + */ + public Builder setExtractiveContentSpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + value) { + if (extractiveContentSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + extractiveContentSpec_ = value; + } else { + extractiveContentSpecBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * If there is no extractive_content_spec provided, there will be no
+       * extractive answer in the search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec extractive_content_spec = 3; + * + */ + public Builder setExtractiveContentSpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec.Builder + builderForValue) { + if (extractiveContentSpecBuilder_ == null) { + extractiveContentSpec_ = builderForValue.build(); + } else { + extractiveContentSpecBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * If there is no extractive_content_spec provided, there will be no
+       * extractive answer in the search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec extractive_content_spec = 3; + * + */ + public Builder mergeExtractiveContentSpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec + value) { + if (extractiveContentSpecBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && extractiveContentSpec_ != null + && extractiveContentSpec_ + != com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec.getDefaultInstance()) { + getExtractiveContentSpecBuilder().mergeFrom(value); + } else { + extractiveContentSpec_ = value; + } + } else { + extractiveContentSpecBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * If there is no extractive_content_spec provided, there will be no
+       * extractive answer in the search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec extractive_content_spec = 3; + * + */ + public Builder clearExtractiveContentSpec() { + bitField0_ = (bitField0_ & ~0x00000004); + extractiveContentSpec_ = null; + if (extractiveContentSpecBuilder_ != null) { + extractiveContentSpecBuilder_.dispose(); + extractiveContentSpecBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * If there is no extractive_content_spec provided, there will be no
+       * extractive answer in the search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec extractive_content_spec = 3; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec.Builder + getExtractiveContentSpecBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getExtractiveContentSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * If there is no extractive_content_spec provided, there will be no
+       * extractive answer in the search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec extractive_content_spec = 3; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpecOrBuilder + getExtractiveContentSpecOrBuilder() { + if (extractiveContentSpecBuilder_ != null) { + return extractiveContentSpecBuilder_.getMessageOrBuilder(); + } else { + return extractiveContentSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec.getDefaultInstance() + : extractiveContentSpec_; + } + } + /** + * + * + *
+       * If there is no extractive_content_spec provided, there will be no
+       * extractive answer in the search response.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec extractive_content_spec = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpecOrBuilder> + getExtractiveContentSpecFieldBuilder() { + if (extractiveContentSpecBuilder_ == null) { + extractiveContentSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .ExtractiveContentSpecOrBuilder>( + getExtractiveContentSpec(), getParentForChildren(), isClean()); + extractiveContentSpec_ = null; + } + return extractiveContentSpecBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec) + private static final com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec(); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ContentSearchSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface EmbeddingSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The embedding vector used for retrieval. Limit to 1.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector> + getEmbeddingVectorsList(); + /** + * + * + *
+     * The embedding vector used for retrieval. Limit to 1.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + getEmbeddingVectors(int index); + /** + * + * + *
+     * The embedding vector used for retrieval. Limit to 1.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + int getEmbeddingVectorsCount(); + /** + * + * + *
+     * The embedding vector used for retrieval. Limit to 1.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVectorOrBuilder> + getEmbeddingVectorsOrBuilderList(); + /** + * + * + *
+     * The embedding vector used for retrieval. Limit to 1.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVectorOrBuilder + getEmbeddingVectorsOrBuilder(int index); + } + /** + * + * + *
+   * The specification that uses customized query embedding vector to do
+   * semantic document retrieval.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec} + */ + public static final class EmbeddingSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec) + EmbeddingSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use EmbeddingSpec.newBuilder() to construct. + private EmbeddingSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EmbeddingSpec() { + embeddingVectors_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EmbeddingSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_EmbeddingSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_EmbeddingSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.Builder.class); + } + + public interface EmbeddingVectorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Embedding field path in schema.
+       * 
+ * + * string field_path = 1; + * + * @return The fieldPath. + */ + java.lang.String getFieldPath(); + /** + * + * + *
+       * Embedding field path in schema.
+       * 
+ * + * string field_path = 1; + * + * @return The bytes for fieldPath. + */ + com.google.protobuf.ByteString getFieldPathBytes(); + + /** + * + * + *
+       * Query embedding vector.
+       * 
+ * + * repeated float vector = 2; + * + * @return A list containing the vector. + */ + java.util.List getVectorList(); + /** + * + * + *
+       * Query embedding vector.
+       * 
+ * + * repeated float vector = 2; + * + * @return The count of vector. + */ + int getVectorCount(); + /** + * + * + *
+       * Query embedding vector.
+       * 
+ * + * repeated float vector = 2; + * + * @param index The index of the element to return. + * @return The vector at the given index. + */ + float getVector(int index); + } + /** + * + * + *
+     * Embedding vector.
+     * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector} + */ + public static final class EmbeddingVector extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector) + EmbeddingVectorOrBuilder { + private static final long serialVersionUID = 0L; + // Use EmbeddingVector.newBuilder() to construct. + private EmbeddingVector(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EmbeddingVector() { + fieldPath_ = ""; + vector_ = emptyFloatList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EmbeddingVector(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_EmbeddingSpec_EmbeddingVector_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_EmbeddingSpec_EmbeddingVector_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + .class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + .Builder.class); + } + + public static final int FIELD_PATH_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object fieldPath_ = ""; + /** + * + * + *
+       * Embedding field path in schema.
+       * 
+ * + * string field_path = 1; + * + * @return The fieldPath. + */ + @java.lang.Override + public java.lang.String getFieldPath() { + java.lang.Object ref = fieldPath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fieldPath_ = s; + return s; + } + } + /** + * + * + *
+       * Embedding field path in schema.
+       * 
+ * + * string field_path = 1; + * + * @return The bytes for fieldPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFieldPathBytes() { + java.lang.Object ref = fieldPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VECTOR_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.FloatList vector_; + /** + * + * + *
+       * Query embedding vector.
+       * 
+ * + * repeated float vector = 2; + * + * @return A list containing the vector. + */ + @java.lang.Override + public java.util.List getVectorList() { + return vector_; + } + /** + * + * + *
+       * Query embedding vector.
+       * 
+ * + * repeated float vector = 2; + * + * @return The count of vector. + */ + public int getVectorCount() { + return vector_.size(); + } + /** + * + * + *
+       * Query embedding vector.
+       * 
+ * + * repeated float vector = 2; + * + * @param index The index of the element to return. + * @return The vector at the given index. + */ + public float getVector(int index) { + return vector_.getFloat(index); + } + + private int vectorMemoizedSerializedSize = -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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fieldPath_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fieldPath_); + } + if (getVectorList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(vectorMemoizedSerializedSize); + } + for (int i = 0; i < vector_.size(); i++) { + output.writeFloatNoTag(vector_.getFloat(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fieldPath_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fieldPath_); + } + { + int dataSize = 0; + dataSize = 4 * getVectorList().size(); + size += dataSize; + if (!getVectorList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + vectorMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector other = + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector) + obj; + + if (!getFieldPath().equals(other.getFieldPath())) return false; + if (!getVectorList().equals(other.getVectorList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FIELD_PATH_FIELD_NUMBER; + hash = (53 * hash) + getFieldPath().hashCode(); + if (getVectorCount() > 0) { + hash = (37 * hash) + VECTOR_FIELD_NUMBER; + hash = (53 * hash) + getVectorList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * Embedding vector.
+       * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector) + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVectorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_EmbeddingSpec_EmbeddingVector_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_EmbeddingSpec_EmbeddingVector_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + fieldPath_ = ""; + vector_ = emptyFloatList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_EmbeddingSpec_EmbeddingVector_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + build() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + result = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + result) { + if (((bitField0_ & 0x00000002) != 0)) { + vector_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.vector_ = vector_; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.fieldPath_ = fieldPath_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector.getDefaultInstance()) return this; + if (!other.getFieldPath().isEmpty()) { + fieldPath_ = other.fieldPath_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.vector_.isEmpty()) { + if (vector_.isEmpty()) { + vector_ = other.vector_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureVectorIsMutable(); + vector_.addAll(other.vector_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + fieldPath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 21: + { + float v = input.readFloat(); + ensureVectorIsMutable(); + vector_.addFloat(v); + break; + } // case 21 + case 18: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureVectorIsMutable(); + while (input.getBytesUntilLimit() > 0) { + vector_.addFloat(input.readFloat()); + } + input.popLimit(limit); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object fieldPath_ = ""; + /** + * + * + *
+         * Embedding field path in schema.
+         * 
+ * + * string field_path = 1; + * + * @return The fieldPath. + */ + public java.lang.String getFieldPath() { + java.lang.Object ref = fieldPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fieldPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Embedding field path in schema.
+         * 
+ * + * string field_path = 1; + * + * @return The bytes for fieldPath. + */ + public com.google.protobuf.ByteString getFieldPathBytes() { + java.lang.Object ref = fieldPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Embedding field path in schema.
+         * 
+ * + * string field_path = 1; + * + * @param value The fieldPath to set. + * @return This builder for chaining. + */ + public Builder setFieldPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fieldPath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * Embedding field path in schema.
+         * 
+ * + * string field_path = 1; + * + * @return This builder for chaining. + */ + public Builder clearFieldPath() { + fieldPath_ = getDefaultInstance().getFieldPath(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+         * Embedding field path in schema.
+         * 
+ * + * string field_path = 1; + * + * @param value The bytes for fieldPath to set. + * @return This builder for chaining. + */ + public Builder setFieldPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fieldPath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.FloatList vector_ = emptyFloatList(); + + private void ensureVectorIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + vector_ = mutableCopy(vector_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+         * Query embedding vector.
+         * 
+ * + * repeated float vector = 2; + * + * @return A list containing the vector. + */ + public java.util.List getVectorList() { + return ((bitField0_ & 0x00000002) != 0) + ? java.util.Collections.unmodifiableList(vector_) + : vector_; + } + /** + * + * + *
+         * Query embedding vector.
+         * 
+ * + * repeated float vector = 2; + * + * @return The count of vector. + */ + public int getVectorCount() { + return vector_.size(); + } + /** + * + * + *
+         * Query embedding vector.
+         * 
+ * + * repeated float vector = 2; + * + * @param index The index of the element to return. + * @return The vector at the given index. + */ + public float getVector(int index) { + return vector_.getFloat(index); + } + /** + * + * + *
+         * Query embedding vector.
+         * 
+ * + * repeated float vector = 2; + * + * @param index The index to set the value at. + * @param value The vector to set. + * @return This builder for chaining. + */ + public Builder setVector(int index, float value) { + + ensureVectorIsMutable(); + vector_.setFloat(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * Query embedding vector.
+         * 
+ * + * repeated float vector = 2; + * + * @param value The vector to add. + * @return This builder for chaining. + */ + public Builder addVector(float value) { + + ensureVectorIsMutable(); + vector_.addFloat(value); + onChanged(); + return this; + } + /** + * + * + *
+         * Query embedding vector.
+         * 
+ * + * repeated float vector = 2; + * + * @param values The vector to add. + * @return This builder for chaining. + */ + public Builder addAllVector(java.lang.Iterable values) { + ensureVectorIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, vector_); + onChanged(); + return this; + } + /** + * + * + *
+         * Query embedding vector.
+         * 
+ * + * repeated float vector = 2; + * + * @return This builder for chaining. + */ + public Builder clearVector() { + vector_ = emptyFloatList(); + bitField0_ = (bitField0_ & ~0x00000002); + 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.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector) + private static final com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector(); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EmbeddingVector parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int EMBEDDING_VECTORS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector> + embeddingVectors_; + /** + * + * + *
+     * The embedding vector used for retrieval. Limit to 1.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + @java.lang.Override + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector> + getEmbeddingVectorsList() { + return embeddingVectors_; + } + /** + * + * + *
+     * The embedding vector used for retrieval. Limit to 1.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVectorOrBuilder> + getEmbeddingVectorsOrBuilderList() { + return embeddingVectors_; + } + /** + * + * + *
+     * The embedding vector used for retrieval. Limit to 1.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + @java.lang.Override + public int getEmbeddingVectorsCount() { + return embeddingVectors_.size(); + } + /** + * + * + *
+     * The embedding vector used for retrieval. Limit to 1.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + getEmbeddingVectors(int index) { + return embeddingVectors_.get(index); + } + /** + * + * + *
+     * The embedding vector used for retrieval. Limit to 1.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVectorOrBuilder + getEmbeddingVectorsOrBuilder(int index) { + return embeddingVectors_.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 < embeddingVectors_.size(); i++) { + output.writeMessage(1, embeddingVectors_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < embeddingVectors_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, embeddingVectors_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec other = + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec) obj; + + if (!getEmbeddingVectorsList().equals(other.getEmbeddingVectorsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getEmbeddingVectorsCount() > 0) { + hash = (37 * hash) + EMBEDDING_VECTORS_FIELD_NUMBER; + hash = (53 * hash) + getEmbeddingVectorsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 that uses customized query embedding vector to do
+     * semantic document retrieval.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec) + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_EmbeddingSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_EmbeddingSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (embeddingVectorsBuilder_ == null) { + embeddingVectors_ = java.util.Collections.emptyList(); + } else { + embeddingVectors_ = null; + embeddingVectorsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_EmbeddingSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec build() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec result = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec result) { + if (embeddingVectorsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + embeddingVectors_ = java.util.Collections.unmodifiableList(embeddingVectors_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.embeddingVectors_ = embeddingVectors_; + } else { + result.embeddingVectors_ = embeddingVectorsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .getDefaultInstance()) return this; + if (embeddingVectorsBuilder_ == null) { + if (!other.embeddingVectors_.isEmpty()) { + if (embeddingVectors_.isEmpty()) { + embeddingVectors_ = other.embeddingVectors_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEmbeddingVectorsIsMutable(); + embeddingVectors_.addAll(other.embeddingVectors_); + } + onChanged(); + } + } else { + if (!other.embeddingVectors_.isEmpty()) { + if (embeddingVectorsBuilder_.isEmpty()) { + embeddingVectorsBuilder_.dispose(); + embeddingVectorsBuilder_ = null; + embeddingVectors_ = other.embeddingVectors_; + bitField0_ = (bitField0_ & ~0x00000001); + embeddingVectorsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEmbeddingVectorsFieldBuilder() + : null; + } else { + embeddingVectorsBuilder_.addAllMessages(other.embeddingVectors_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector + m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector.parser(), + extensionRegistry); + if (embeddingVectorsBuilder_ == null) { + ensureEmbeddingVectorsIsMutable(); + embeddingVectors_.add(m); + } else { + embeddingVectorsBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector> + embeddingVectors_ = java.util.Collections.emptyList(); + + private void ensureEmbeddingVectorsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + embeddingVectors_ = + new java.util.ArrayList< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector>(embeddingVectors_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + .Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVectorOrBuilder> + embeddingVectorsBuilder_; + + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector> + getEmbeddingVectorsList() { + if (embeddingVectorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(embeddingVectors_); + } else { + return embeddingVectorsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public int getEmbeddingVectorsCount() { + if (embeddingVectorsBuilder_ == null) { + return embeddingVectors_.size(); + } else { + return embeddingVectorsBuilder_.getCount(); + } + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + getEmbeddingVectors(int index) { + if (embeddingVectorsBuilder_ == null) { + return embeddingVectors_.get(index); + } else { + return embeddingVectorsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public Builder setEmbeddingVectors( + int index, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + value) { + if (embeddingVectorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEmbeddingVectorsIsMutable(); + embeddingVectors_.set(index, value); + onChanged(); + } else { + embeddingVectorsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public Builder setEmbeddingVectors( + int index, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + .Builder + builderForValue) { + if (embeddingVectorsBuilder_ == null) { + ensureEmbeddingVectorsIsMutable(); + embeddingVectors_.set(index, builderForValue.build()); + onChanged(); + } else { + embeddingVectorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public Builder addEmbeddingVectors( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + value) { + if (embeddingVectorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEmbeddingVectorsIsMutable(); + embeddingVectors_.add(value); + onChanged(); + } else { + embeddingVectorsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public Builder addEmbeddingVectors( + int index, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + value) { + if (embeddingVectorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEmbeddingVectorsIsMutable(); + embeddingVectors_.add(index, value); + onChanged(); + } else { + embeddingVectorsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public Builder addEmbeddingVectors( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + .Builder + builderForValue) { + if (embeddingVectorsBuilder_ == null) { + ensureEmbeddingVectorsIsMutable(); + embeddingVectors_.add(builderForValue.build()); + onChanged(); + } else { + embeddingVectorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public Builder addEmbeddingVectors( + int index, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + .Builder + builderForValue) { + if (embeddingVectorsBuilder_ == null) { + ensureEmbeddingVectorsIsMutable(); + embeddingVectors_.add(index, builderForValue.build()); + onChanged(); + } else { + embeddingVectorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public Builder addAllEmbeddingVectors( + java.lang.Iterable< + ? extends + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector> + values) { + if (embeddingVectorsBuilder_ == null) { + ensureEmbeddingVectorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, embeddingVectors_); + onChanged(); + } else { + embeddingVectorsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public Builder clearEmbeddingVectors() { + if (embeddingVectorsBuilder_ == null) { + embeddingVectors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + embeddingVectorsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public Builder removeEmbeddingVectors(int index) { + if (embeddingVectorsBuilder_ == null) { + ensureEmbeddingVectorsIsMutable(); + embeddingVectors_.remove(index); + onChanged(); + } else { + embeddingVectorsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + .Builder + getEmbeddingVectorsBuilder(int index) { + return getEmbeddingVectorsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVectorOrBuilder + getEmbeddingVectorsOrBuilder(int index) { + if (embeddingVectorsBuilder_ == null) { + return embeddingVectors_.get(index); + } else { + return embeddingVectorsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVectorOrBuilder> + getEmbeddingVectorsOrBuilderList() { + if (embeddingVectorsBuilder_ != null) { + return embeddingVectorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(embeddingVectors_); + } + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + .Builder + addEmbeddingVectorsBuilder() { + return getEmbeddingVectorsFieldBuilder() + .addBuilder( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + .getDefaultInstance()); + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + .Builder + addEmbeddingVectorsBuilder(int index) { + return getEmbeddingVectorsFieldBuilder() + .addBuilder( + index, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + .getDefaultInstance()); + } + /** + * + * + *
+       * The embedding vector used for retrieval. Limit to 1.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector embedding_vectors = 1; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + .Builder> + getEmbeddingVectorsBuilderList() { + return getEmbeddingVectorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector + .Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVectorOrBuilder> + getEmbeddingVectorsFieldBuilder() { + if (embeddingVectorsBuilder_ == null) { + embeddingVectorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVector.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .EmbeddingVectorOrBuilder>( + embeddingVectors_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + embeddingVectors_ = null; + } + return embeddingVectorsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec) + private static final com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec(); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EmbeddingSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int SERVING_CONFIG_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object servingConfig_ = ""; + /** + * + * + *
+   * Required. The resource name of the Search serving config, such as
+   * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
+   * This field is used to identify the serving configuration name, set
+   * of models used to make the search.
+   * 
+ * + * + * 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 resource name of the Search serving config, such as
+   * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
+   * This field is used to identify the serving configuration name, set
+   * of models used to make the search.
+   * 
+ * + * + * 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 BRANCH_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object branch_ = ""; + /** + * + * + *
+   * The branch resource name, such as
+   * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`.
+   *
+   * Use `default_branch` as the branch ID or leave this field empty, to search
+   * documents 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/collections/default_collection/dataStores/default_data_store/branches/0`.
+   *
+   * Use `default_branch` as the branch ID or leave this field empty, to search
+   * documents 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; + + @SuppressWarnings("serial") + 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 IMAGE_QUERY_FIELD_NUMBER = 19; + private com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery imageQuery_; + /** + * + * + *
+   * Raw image query.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery image_query = 19; + * + * @return Whether the imageQuery field is set. + */ + @java.lang.Override + public boolean hasImageQuery() { + return imageQuery_ != null; + } + /** + * + * + *
+   * Raw image query.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery image_query = 19; + * + * @return The imageQuery. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery getImageQuery() { + return imageQuery_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery.getDefaultInstance() + : imageQuery_; + } + /** + * + * + *
+   * Raw image query.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery image_query = 19; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQueryOrBuilder + getImageQueryOrBuilder() { + return imageQuery_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery.getDefaultInstance() + : imageQuery_; + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 4; + private int pageSize_ = 0; + /** + * + * + *
+   * Maximum number of
+   * [Document][google.cloud.discoveryengine.v1alpha.Document]s to return. If
+   * unspecified, defaults to a reasonable value. The maximum allowed value is
+   * 100. Values above 100 are coerced to 100.
+   *
+   * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+   * 
+ * + * int32 page_size = 4; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A page token received from a previous
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+   * call. Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+   * must match the call that provided the page token. Otherwise, an
+   *  `INVALID_ARGUMENT`  error is returned.
+   * 
+ * + * string page_token = 5; + * + * @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 received from a previous
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+   * call. Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+   * must match the call that provided the page token. Otherwise, an
+   *  `INVALID_ARGUMENT`  error is returned.
+   * 
+ * + * string page_token = 5; + * + * @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 = 6; + private int offset_ = 0; + /** + * + * + *
+   * A 0-indexed integer that specifies the current offset (that is, starting
+   * result location, amongst the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document]s deemed by the
+   * API as relevant) in search results. This field is only considered if
+   * [page_token][google.cloud.discoveryengine.v1alpha.SearchRequest.page_token]
+   * is unset.
+   *
+   * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+   * 
+ * + * int32 offset = 6; + * + * @return The offset. + */ + @java.lang.Override + public int getOffset() { + return offset_; + } + + public static final int FILTER_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + 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 documents being filtered. Filter
+   * expression is case-sensitive.
+   *
+   * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
+   * 
+ * + * string filter = 7; + * + * @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 documents being filtered. Filter
+   * expression is case-sensitive.
+   *
+   * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
+   * 
+ * + * string filter = 7; + * + * @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 = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * The order in which documents are returned. Documents can be ordered by
+   * a field in an [Document][google.cloud.discoveryengine.v1alpha.Document]
+   * object. Leave it unset if ordered by relevance. `order_by` expression is
+   * case-sensitive.
+   *
+   * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
+   * 
+ * + * string order_by = 8; + * + * @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 documents are returned. Documents can be ordered by
+   * a field in an [Document][google.cloud.discoveryengine.v1alpha.Document]
+   * object. Leave it unset if ordered by relevance. `order_by` expression is
+   * case-sensitive.
+   *
+   * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
+   * 
+ * + * string order_by = 8; + * + * @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 USER_INFO_FIELD_NUMBER = 21; + private com.google.cloud.discoveryengine.v1alpha.UserInfo userInfo_; + /** + * + * + *
+   * Information about the end user.
+   * Highly recommended for analytics.
+   * [UserInfo.user_agent][google.cloud.discoveryengine.v1alpha.UserInfo.user_agent]
+   * is used to deduce `device_type` for analytics.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 21; + * + * @return Whether the userInfo field is set. + */ + @java.lang.Override + public boolean hasUserInfo() { + return userInfo_ != null; + } + /** + * + * + *
+   * Information about the end user.
+   * Highly recommended for analytics.
+   * [UserInfo.user_agent][google.cloud.discoveryengine.v1alpha.UserInfo.user_agent]
+   * is used to deduce `device_type` for analytics.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 21; + * + * @return The userInfo. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UserInfo getUserInfo() { + return userInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.UserInfo.getDefaultInstance() + : userInfo_; + } + /** + * + * + *
+   * Information about the end user.
+   * Highly recommended for analytics.
+   * [UserInfo.user_agent][google.cloud.discoveryengine.v1alpha.UserInfo.user_agent]
+   * is used to deduce `device_type` for analytics.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 21; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UserInfoOrBuilder getUserInfoOrBuilder() { + return userInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.UserInfo.getDefaultInstance() + : userInfo_; + } + + public static final int FACET_SPECS_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + 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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + @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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpecOrBuilder> + 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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + @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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpecOrBuilder + getFacetSpecsOrBuilder(int index) { + return facetSpecs_.get(index); + } + + public static final int BOOST_SPEC_FIELD_NUMBER = 10; + private com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec boostSpec_; + /** + * + * + *
+   * Boost specification to boost certain documents.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec boost_spec = 10; + * + * @return Whether the boostSpec field is set. + */ + @java.lang.Override + public boolean hasBoostSpec() { + return boostSpec_ != null; + } + /** + * + * + *
+   * Boost specification to boost certain documents.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec boost_spec = 10; + * + * @return The boostSpec. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec getBoostSpec() { + return boostSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.getDefaultInstance() + : boostSpec_; + } + /** + * + * + *
+   * Boost specification to boost certain documents.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec boost_spec = 10; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpecOrBuilder + getBoostSpecOrBuilder() { + return boostSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.getDefaultInstance() + : boostSpec_; + } + + public static final int PARAMS_FIELD_NUMBER = 11; + + private static final class ParamsDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ParamsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.Value.getDefaultInstance()); + } + + @SuppressWarnings("serial") + 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 search parameters.
+   *
+   * For public website search only, supported values are:
+   *
+   * * `user_country_code`: string. Default empty. If set to non-empty, results
+   *    are restricted or boosted based on the location provided.
+   * * `search_type`: double. Default empty. Enables non-webpage searching
+   *   depending on the value. The only valid non-default value is 1,
+   *   which enables image searching.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 11; + */ + @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 search parameters.
+   *
+   * For public website search only, supported values are:
+   *
+   * * `user_country_code`: string. Default empty. If set to non-empty, results
+   *    are restricted or boosted based on the location provided.
+   * * `search_type`: double. Default empty. Enables non-webpage searching
+   *   depending on the value. The only valid non-default value is 1,
+   *   which enables image searching.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 11; + */ + @java.lang.Override + public java.util.Map getParamsMap() { + return internalGetParams().getMap(); + } + /** + * + * + *
+   * Additional search parameters.
+   *
+   * For public website search only, supported values are:
+   *
+   * * `user_country_code`: string. Default empty. If set to non-empty, results
+   *    are restricted or boosted based on the location provided.
+   * * `search_type`: double. Default empty. Enables non-webpage searching
+   *   depending on the value. The only valid non-default value is 1,
+   *   which enables image searching.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 11; + */ + @java.lang.Override + public /* nullable */ com.google.protobuf.Value getParamsOrDefault( + java.lang.String key, + /* nullable */ + 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 search parameters.
+   *
+   * For public website search only, supported values are:
+   *
+   * * `user_country_code`: string. Default empty. If set to non-empty, results
+   *    are restricted or boosted based on the location provided.
+   * * `search_type`: double. Default empty. Enables non-webpage searching
+   *   depending on the value. The only valid non-default value is 1,
+   *   which enables image searching.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 11; + */ + @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 QUERY_EXPANSION_SPEC_FIELD_NUMBER = 13; + private com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec + queryExpansionSpec_; + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion occurs.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 13; + * + * + * @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 occurs.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 13; + * + * + * @return The queryExpansionSpec. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec + getQueryExpansionSpec() { + return queryExpansionSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec + .getDefaultInstance() + : queryExpansionSpec_; + } + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion occurs.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 13; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpecOrBuilder + getQueryExpansionSpecOrBuilder() { + return queryExpansionSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec + .getDefaultInstance() + : queryExpansionSpec_; + } + + public static final int SPELL_CORRECTION_SPEC_FIELD_NUMBER = 14; + private com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + spellCorrectionSpec_; + /** + * + * + *
+   * The spell correction specification that specifies the mode under
+   * which spell correction takes effect.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14; + * + * + * @return Whether the spellCorrectionSpec field is set. + */ + @java.lang.Override + public boolean hasSpellCorrectionSpec() { + return spellCorrectionSpec_ != null; + } + /** + * + * + *
+   * The spell correction specification that specifies the mode under
+   * which spell correction takes effect.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14; + * + * + * @return The spellCorrectionSpec. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + getSpellCorrectionSpec() { + return spellCorrectionSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + .getDefaultInstance() + : spellCorrectionSpec_; + } + /** + * + * + *
+   * The spell correction specification that specifies the mode under
+   * which spell correction takes effect.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpecOrBuilder + getSpellCorrectionSpecOrBuilder() { + return spellCorrectionSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + .getDefaultInstance() + : spellCorrectionSpec_; + } + + public static final int USER_PSEUDO_ID_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private volatile java.lang.Object userPseudoId_ = ""; + /** + * + * + *
+   * 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 field should NOT have a fixed value such as `unknown_visitor`.
+   *
+   * This should be the same identifier as
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * and
+   * [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1alpha.CompleteQueryRequest.user_pseudo_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_pseudo_id = 15; + * + * @return The userPseudoId. + */ + @java.lang.Override + public java.lang.String getUserPseudoId() { + java.lang.Object ref = userPseudoId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userPseudoId_ = s; + return s; + } + } + /** + * + * + *
+   * 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 field should NOT have a fixed value such as `unknown_visitor`.
+   *
+   * This should be the same identifier as
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * and
+   * [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1alpha.CompleteQueryRequest.user_pseudo_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_pseudo_id = 15; + * + * @return The bytes for userPseudoId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserPseudoIdBytes() { + java.lang.Object ref = userPseudoId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userPseudoId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_SEARCH_SPEC_FIELD_NUMBER = 24; + private com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + contentSearchSpec_; + /** + * + * + *
+   * A specification for configuring the behavior of content search.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec content_search_spec = 24; + * + * + * @return Whether the contentSearchSpec field is set. + */ + @java.lang.Override + public boolean hasContentSearchSpec() { + return contentSearchSpec_ != null; + } + /** + * + * + *
+   * A specification for configuring the behavior of content search.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec content_search_spec = 24; + * + * + * @return The contentSearchSpec. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + getContentSearchSpec() { + return contentSearchSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .getDefaultInstance() + : contentSearchSpec_; + } + /** + * + * + *
+   * A specification for configuring the behavior of content search.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec content_search_spec = 24; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpecOrBuilder + getContentSearchSpecOrBuilder() { + return contentSearchSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .getDefaultInstance() + : contentSearchSpec_; + } + + public static final int EMBEDDING_SPEC_FIELD_NUMBER = 23; + private com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec embeddingSpec_; + /** + * + * + *
+   * Uses the provided embedding to do additional semantic document retrieval.
+   * The retrieval is based on the dot product of
+   * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+   * embedding that is provided in
+   * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+   *
+   * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+   * provided, it will use [ServingConfig.embedding_config.field_paths][].
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + * + * @return Whether the embeddingSpec field is set. + */ + @java.lang.Override + public boolean hasEmbeddingSpec() { + return embeddingSpec_ != null; + } + /** + * + * + *
+   * Uses the provided embedding to do additional semantic document retrieval.
+   * The retrieval is based on the dot product of
+   * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+   * embedding that is provided in
+   * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+   *
+   * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+   * provided, it will use [ServingConfig.embedding_config.field_paths][].
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + * + * @return The embeddingSpec. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec getEmbeddingSpec() { + return embeddingSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.getDefaultInstance() + : embeddingSpec_; + } + /** + * + * + *
+   * Uses the provided embedding to do additional semantic document retrieval.
+   * The retrieval is based on the dot product of
+   * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+   * embedding that is provided in
+   * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+   *
+   * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+   * provided, it will use [ServingConfig.embedding_config.field_paths][].
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpecOrBuilder + getEmbeddingSpecOrBuilder() { + return embeddingSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.getDefaultInstance() + : embeddingSpec_; + } + + public static final int RANKING_EXPRESSION_FIELD_NUMBER = 26; + + @SuppressWarnings("serial") + private volatile java.lang.Object rankingExpression_ = ""; + /** + * + * + *
+   * The ranking expression controls the customized ranking on retrieval
+   * documents. This overrides
+   * [ServingConfig.ranking_expression][google.cloud.discoveryengine.v1alpha.ServingConfig.ranking_expression].
+   * The ranking expression is a single function or multiple functions that are
+   * joint by "+".
+   *   * ranking_expression = function, { " + ", function };
+   * Supported functions:
+   *   * double * relevance_score
+   *   * double * dotProduct(embedding_field_path)
+   * Function variables:
+   *   `relevance_score`: pre-defined keywords, used for measure relevance
+   *   between query and document.
+   *   `embedding_field_path`: the document embedding field
+   *   used with query embedding vector.
+   *   `dotProduct`: embedding function between embedding_field_path and query
+   *   embedding vector.
+   *
+   *  Example ranking expression:
+   *    If document has an embedding field doc_embedding, the ranking expression
+   *    could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
+   * 
+ * + * string ranking_expression = 26; + * + * @return The rankingExpression. + */ + @java.lang.Override + public java.lang.String getRankingExpression() { + java.lang.Object ref = rankingExpression_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + rankingExpression_ = s; + return s; + } + } + /** + * + * + *
+   * The ranking expression controls the customized ranking on retrieval
+   * documents. This overrides
+   * [ServingConfig.ranking_expression][google.cloud.discoveryengine.v1alpha.ServingConfig.ranking_expression].
+   * The ranking expression is a single function or multiple functions that are
+   * joint by "+".
+   *   * ranking_expression = function, { " + ", function };
+   * Supported functions:
+   *   * double * relevance_score
+   *   * double * dotProduct(embedding_field_path)
+   * Function variables:
+   *   `relevance_score`: pre-defined keywords, used for measure relevance
+   *   between query and document.
+   *   `embedding_field_path`: the document embedding field
+   *   used with query embedding vector.
+   *   `dotProduct`: embedding function between embedding_field_path and query
+   *   embedding vector.
+   *
+   *  Example ranking expression:
+   *    If document has an embedding field doc_embedding, the ranking expression
+   *    could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
+   * 
+ * + * string ranking_expression = 26; + * + * @return The bytes for rankingExpression. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRankingExpressionBytes() { + java.lang.Object ref = rankingExpression_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rankingExpression_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SAFE_SEARCH_FIELD_NUMBER = 20; + private boolean safeSearch_ = false; + /** + * + * + *
+   * Whether to turn on safe search. This is only supported for
+   * website search.
+   * 
+ * + * bool safe_search = 20; + * + * @return The safeSearch. + */ + @java.lang.Override + public boolean getSafeSearch() { + return safeSearch_; + } + + public static final int USER_LABELS_FIELD_NUMBER = 22; + + private static final class UserLabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_UserLabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField userLabels_; + + private com.google.protobuf.MapField internalGetUserLabels() { + if (userLabels_ == null) { + return com.google.protobuf.MapField.emptyMapField(UserLabelsDefaultEntryHolder.defaultEntry); + } + return userLabels_; + } + + public int getUserLabelsCount() { + return internalGetUserLabels().getMap().size(); + } + /** + * + * + *
+   * The user 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> user_labels = 22; + */ + @java.lang.Override + public boolean containsUserLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetUserLabels().getMap().containsKey(key); + } + /** Use {@link #getUserLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getUserLabels() { + return getUserLabelsMap(); + } + /** + * + * + *
+   * The user 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> user_labels = 22; + */ + @java.lang.Override + public java.util.Map getUserLabelsMap() { + return internalGetUserLabels().getMap(); + } + /** + * + * + *
+   * The user 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> user_labels = 22; + */ + @java.lang.Override + public /* nullable */ java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * The user 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> user_labels = 22; + */ + @java.lang.Override + public java.lang.String getUserLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().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(servingConfig_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, servingConfig_); + } + 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 (pageSize_ != 0) { + output.writeInt32(4, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, pageToken_); + } + if (offset_ != 0) { + output.writeInt32(6, offset_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, orderBy_); + } + for (int i = 0; i < facetSpecs_.size(); i++) { + output.writeMessage(9, facetSpecs_.get(i)); + } + if (boostSpec_ != null) { + output.writeMessage(10, getBoostSpec()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetParams(), ParamsDefaultEntryHolder.defaultEntry, 11); + if (queryExpansionSpec_ != null) { + output.writeMessage(13, getQueryExpansionSpec()); + } + if (spellCorrectionSpec_ != null) { + output.writeMessage(14, getSpellCorrectionSpec()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userPseudoId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, userPseudoId_); + } + if (imageQuery_ != null) { + output.writeMessage(19, getImageQuery()); + } + if (safeSearch_ != false) { + output.writeBool(20, safeSearch_); + } + if (userInfo_ != null) { + output.writeMessage(21, getUserInfo()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetUserLabels(), UserLabelsDefaultEntryHolder.defaultEntry, 22); + if (embeddingSpec_ != null) { + output.writeMessage(23, getEmbeddingSpec()); + } + if (contentSearchSpec_ != null) { + output.writeMessage(24, getContentSearchSpec()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rankingExpression_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 26, rankingExpression_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(servingConfig_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, servingConfig_); + } + 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 (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, pageToken_); + } + if (offset_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, offset_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, orderBy_); + } + for (int i = 0; i < facetSpecs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, facetSpecs_.get(i)); + } + if (boostSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getBoostSpec()); + } + 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(11, params__); + } + if (queryExpansionSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getQueryExpansionSpec()); + } + if (spellCorrectionSpec_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(14, getSpellCorrectionSpec()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userPseudoId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, userPseudoId_); + } + if (imageQuery_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, getImageQuery()); + } + if (safeSearch_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(20, safeSearch_); + } + if (userInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, getUserInfo()); + } + for (java.util.Map.Entry entry : + internalGetUserLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry userLabels__ = + UserLabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(22, userLabels__); + } + if (embeddingSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(23, getEmbeddingSpec()); + } + if (contentSearchSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(24, getContentSearchSpec()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rankingExpression_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(26, rankingExpression_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.SearchRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchRequest other = + (com.google.cloud.discoveryengine.v1alpha.SearchRequest) obj; + + if (!getServingConfig().equals(other.getServingConfig())) return false; + if (!getBranch().equals(other.getBranch())) return false; + if (!getQuery().equals(other.getQuery())) return false; + if (hasImageQuery() != other.hasImageQuery()) return false; + if (hasImageQuery()) { + if (!getImageQuery().equals(other.getImageQuery())) 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 (!getOrderBy().equals(other.getOrderBy())) return false; + if (hasUserInfo() != other.hasUserInfo()) return false; + if (hasUserInfo()) { + if (!getUserInfo().equals(other.getUserInfo())) return false; + } + if (!getFacetSpecsList().equals(other.getFacetSpecsList())) return false; + if (hasBoostSpec() != other.hasBoostSpec()) return false; + if (hasBoostSpec()) { + if (!getBoostSpec().equals(other.getBoostSpec())) return false; + } + if (!internalGetParams().equals(other.internalGetParams())) return false; + if (hasQueryExpansionSpec() != other.hasQueryExpansionSpec()) return false; + if (hasQueryExpansionSpec()) { + if (!getQueryExpansionSpec().equals(other.getQueryExpansionSpec())) return false; + } + if (hasSpellCorrectionSpec() != other.hasSpellCorrectionSpec()) return false; + if (hasSpellCorrectionSpec()) { + if (!getSpellCorrectionSpec().equals(other.getSpellCorrectionSpec())) return false; + } + if (!getUserPseudoId().equals(other.getUserPseudoId())) return false; + if (hasContentSearchSpec() != other.hasContentSearchSpec()) return false; + if (hasContentSearchSpec()) { + if (!getContentSearchSpec().equals(other.getContentSearchSpec())) return false; + } + if (hasEmbeddingSpec() != other.hasEmbeddingSpec()) return false; + if (hasEmbeddingSpec()) { + if (!getEmbeddingSpec().equals(other.getEmbeddingSpec())) return false; + } + if (!getRankingExpression().equals(other.getRankingExpression())) return false; + if (getSafeSearch() != other.getSafeSearch()) return false; + if (!internalGetUserLabels().equals(other.internalGetUserLabels())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SERVING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getServingConfig().hashCode(); + hash = (37 * hash) + BRANCH_FIELD_NUMBER; + hash = (53 * hash) + getBranch().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + if (hasImageQuery()) { + hash = (37 * hash) + IMAGE_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getImageQuery().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) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + if (hasUserInfo()) { + hash = (37 * hash) + USER_INFO_FIELD_NUMBER; + hash = (53 * hash) + getUserInfo().hashCode(); + } + if (getFacetSpecsCount() > 0) { + hash = (37 * hash) + FACET_SPECS_FIELD_NUMBER; + hash = (53 * hash) + getFacetSpecsList().hashCode(); + } + if (hasBoostSpec()) { + hash = (37 * hash) + BOOST_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getBoostSpec().hashCode(); + } + if (!internalGetParams().getMap().isEmpty()) { + hash = (37 * hash) + PARAMS_FIELD_NUMBER; + hash = (53 * hash) + internalGetParams().hashCode(); + } + if (hasQueryExpansionSpec()) { + hash = (37 * hash) + QUERY_EXPANSION_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getQueryExpansionSpec().hashCode(); + } + if (hasSpellCorrectionSpec()) { + hash = (37 * hash) + SPELL_CORRECTION_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getSpellCorrectionSpec().hashCode(); + } + hash = (37 * hash) + USER_PSEUDO_ID_FIELD_NUMBER; + hash = (53 * hash) + getUserPseudoId().hashCode(); + if (hasContentSearchSpec()) { + hash = (37 * hash) + CONTENT_SEARCH_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getContentSearchSpec().hashCode(); + } + if (hasEmbeddingSpec()) { + hash = (37 * hash) + EMBEDDING_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getEmbeddingSpec().hashCode(); + } + hash = (37 * hash) + RANKING_EXPRESSION_FIELD_NUMBER; + hash = (53 * hash) + getRankingExpression().hashCode(); + hash = (37 * hash) + SAFE_SEARCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSafeSearch()); + if (!internalGetUserLabels().getMap().isEmpty()) { + hash = (37 * hash) + USER_LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetUserLabels().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchService.Search]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchRequest) + com.google.cloud.discoveryengine.v1alpha.SearchRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 11: + return internalGetParams(); + case 22: + return internalGetUserLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 11: + return internalGetMutableParams(); + case 22: + return internalGetMutableUserLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.class, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.SearchRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + servingConfig_ = ""; + branch_ = ""; + query_ = ""; + imageQuery_ = null; + if (imageQueryBuilder_ != null) { + imageQueryBuilder_.dispose(); + imageQueryBuilder_ = null; + } + pageSize_ = 0; + pageToken_ = ""; + offset_ = 0; + filter_ = ""; + orderBy_ = ""; + userInfo_ = null; + if (userInfoBuilder_ != null) { + userInfoBuilder_.dispose(); + userInfoBuilder_ = null; + } + if (facetSpecsBuilder_ == null) { + facetSpecs_ = java.util.Collections.emptyList(); + } else { + facetSpecs_ = null; + facetSpecsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + boostSpec_ = null; + if (boostSpecBuilder_ != null) { + boostSpecBuilder_.dispose(); + boostSpecBuilder_ = null; + } + internalGetMutableParams().clear(); + queryExpansionSpec_ = null; + if (queryExpansionSpecBuilder_ != null) { + queryExpansionSpecBuilder_.dispose(); + queryExpansionSpecBuilder_ = null; + } + spellCorrectionSpec_ = null; + if (spellCorrectionSpecBuilder_ != null) { + spellCorrectionSpecBuilder_.dispose(); + spellCorrectionSpecBuilder_ = null; + } + userPseudoId_ = ""; + contentSearchSpec_ = null; + if (contentSearchSpecBuilder_ != null) { + contentSearchSpecBuilder_.dispose(); + contentSearchSpecBuilder_ = null; + } + embeddingSpec_ = null; + if (embeddingSpecBuilder_ != null) { + embeddingSpecBuilder_.dispose(); + embeddingSpecBuilder_ = null; + } + rankingExpression_ = ""; + safeSearch_ = false; + internalGetMutableUserLabels().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest build() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchRequest result = + new com.google.cloud.discoveryengine.v1alpha.SearchRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.SearchRequest result) { + if (facetSpecsBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0)) { + facetSpecs_ = java.util.Collections.unmodifiableList(facetSpecs_); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.facetSpecs_ = facetSpecs_; + } else { + result.facetSpecs_ = facetSpecsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.SearchRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.servingConfig_ = servingConfig_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.branch_ = branch_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.query_ = query_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.imageQuery_ = imageQueryBuilder_ == null ? imageQuery_ : imageQueryBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.offset_ = offset_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.orderBy_ = orderBy_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.userInfo_ = userInfoBuilder_ == null ? userInfo_ : userInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.boostSpec_ = boostSpecBuilder_ == null ? boostSpec_ : boostSpecBuilder_.build(); + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.params_ = internalGetParams(); + result.params_.makeImmutable(); + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.queryExpansionSpec_ = + queryExpansionSpecBuilder_ == null + ? queryExpansionSpec_ + : queryExpansionSpecBuilder_.build(); + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.spellCorrectionSpec_ = + spellCorrectionSpecBuilder_ == null + ? spellCorrectionSpec_ + : spellCorrectionSpecBuilder_.build(); + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.userPseudoId_ = userPseudoId_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.contentSearchSpec_ = + contentSearchSpecBuilder_ == null + ? contentSearchSpec_ + : contentSearchSpecBuilder_.build(); + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.embeddingSpec_ = + embeddingSpecBuilder_ == null ? embeddingSpec_ : embeddingSpecBuilder_.build(); + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.rankingExpression_ = rankingExpression_; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.safeSearch_ = safeSearch_; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.userLabels_ = internalGetUserLabels(); + result.userLabels_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.SearchRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.SearchRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.SearchRequest other) { + if (other == com.google.cloud.discoveryengine.v1alpha.SearchRequest.getDefaultInstance()) + return this; + if (!other.getServingConfig().isEmpty()) { + servingConfig_ = other.servingConfig_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getBranch().isEmpty()) { + branch_ = other.branch_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasImageQuery()) { + mergeImageQuery(other.getImageQuery()); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.getOffset() != 0) { + setOffset(other.getOffset()); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000100; + onChanged(); + } + if (other.hasUserInfo()) { + mergeUserInfo(other.getUserInfo()); + } + if (facetSpecsBuilder_ == null) { + if (!other.facetSpecs_.isEmpty()) { + if (facetSpecs_.isEmpty()) { + facetSpecs_ = other.facetSpecs_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureFacetSpecsIsMutable(); + facetSpecs_.addAll(other.facetSpecs_); + } + onChanged(); + } + } else { + if (!other.facetSpecs_.isEmpty()) { + if (facetSpecsBuilder_.isEmpty()) { + facetSpecsBuilder_.dispose(); + facetSpecsBuilder_ = null; + facetSpecs_ = other.facetSpecs_; + bitField0_ = (bitField0_ & ~0x00000400); + facetSpecsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFacetSpecsFieldBuilder() + : null; + } else { + facetSpecsBuilder_.addAllMessages(other.facetSpecs_); + } + } + } + if (other.hasBoostSpec()) { + mergeBoostSpec(other.getBoostSpec()); + } + internalGetMutableParams().mergeFrom(other.internalGetParams()); + bitField0_ |= 0x00001000; + if (other.hasQueryExpansionSpec()) { + mergeQueryExpansionSpec(other.getQueryExpansionSpec()); + } + if (other.hasSpellCorrectionSpec()) { + mergeSpellCorrectionSpec(other.getSpellCorrectionSpec()); + } + if (!other.getUserPseudoId().isEmpty()) { + userPseudoId_ = other.userPseudoId_; + bitField0_ |= 0x00008000; + onChanged(); + } + if (other.hasContentSearchSpec()) { + mergeContentSearchSpec(other.getContentSearchSpec()); + } + if (other.hasEmbeddingSpec()) { + mergeEmbeddingSpec(other.getEmbeddingSpec()); + } + if (!other.getRankingExpression().isEmpty()) { + rankingExpression_ = other.rankingExpression_; + bitField0_ |= 0x00040000; + onChanged(); + } + if (other.getSafeSearch() != false) { + setSafeSearch(other.getSafeSearch()); + } + internalGetMutableUserLabels().mergeFrom(other.internalGetUserLabels()); + bitField0_ |= 0x00100000; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + servingConfig_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + branch_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + query_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 32 + case 42: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 48: + { + offset_ = input.readInt32(); + bitField0_ |= 0x00000040; + break; + } // case 48 + case 58: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 58 + case 66: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 66 + case 74: + { + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.parser(), + extensionRegistry); + if (facetSpecsBuilder_ == null) { + ensureFacetSpecsIsMutable(); + facetSpecs_.add(m); + } else { + facetSpecsBuilder_.addMessage(m); + } + break; + } // case 74 + case 82: + { + input.readMessage(getBoostSpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 82 + case 90: + { + com.google.protobuf.MapEntry params__ = + input.readMessage( + ParamsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableParams() + .getMutableMap() + .put(params__.getKey(), params__.getValue()); + bitField0_ |= 0x00001000; + break; + } // case 90 + case 106: + { + input.readMessage( + getQueryExpansionSpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 106 + case 114: + { + input.readMessage( + getSpellCorrectionSpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00004000; + break; + } // case 114 + case 122: + { + userPseudoId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00008000; + break; + } // case 122 + case 154: + { + input.readMessage(getImageQueryFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 154 + case 160: + { + safeSearch_ = input.readBool(); + bitField0_ |= 0x00080000; + break; + } // case 160 + case 170: + { + input.readMessage(getUserInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 170 + case 178: + { + com.google.protobuf.MapEntry userLabels__ = + input.readMessage( + UserLabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableUserLabels() + .getMutableMap() + .put(userLabels__.getKey(), userLabels__.getValue()); + bitField0_ |= 0x00100000; + break; + } // case 178 + case 186: + { + input.readMessage(getEmbeddingSpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00020000; + break; + } // case 186 + case 194: + { + input.readMessage( + getContentSearchSpecFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00010000; + break; + } // case 194 + case 210: + { + rankingExpression_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00040000; + break; + } // case 210 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object servingConfig_ = ""; + /** + * + * + *
+     * Required. The resource name of the Search serving config, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
+     * This field is used to identify the serving configuration name, set
+     * of models used to make the search.
+     * 
+ * + * + * 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 resource name of the Search serving config, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
+     * This field is used to identify the serving configuration name, set
+     * of models used to make the search.
+     * 
+ * + * + * 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 resource name of the Search serving config, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
+     * This field is used to identify the serving configuration name, set
+     * of models used to make the search.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Search serving config, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
+     * This field is used to identify the serving configuration name, set
+     * of models used to make the search.
+     * 
+ * + * + * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearServingConfig() { + servingConfig_ = getDefaultInstance().getServingConfig(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Search serving config, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
+     * This field is used to identify the serving configuration name, set
+     * of models used to make the search.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object branch_ = ""; + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`.
+     *
+     * Use `default_branch` as the branch ID or leave this field empty, to search
+     * documents 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/collections/default_collection/dataStores/default_data_store/branches/0`.
+     *
+     * Use `default_branch` as the branch ID or leave this field empty, to search
+     * documents 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/collections/default_collection/dataStores/default_data_store/branches/0`.
+     *
+     * Use `default_branch` as the branch ID or leave this field empty, to search
+     * documents 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`.
+     *
+     * Use `default_branch` as the branch ID or leave this field empty, to search
+     * documents under the default branch.
+     * 
+ * + * string branch = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearBranch() { + branch_ = getDefaultInstance().getBranch(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The branch resource name, such as
+     * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`.
+     *
+     * Use `default_branch` as the branch ID or leave this field empty, to search
+     * documents 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; + bitField0_ |= 0x00000002; + 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Raw search query.
+     * 
+ * + * string query = 3; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + query_ = getDefaultInstance().getQuery(); + bitField0_ = (bitField0_ & ~0x00000004); + 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery imageQuery_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQueryOrBuilder> + imageQueryBuilder_; + /** + * + * + *
+     * Raw image query.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery image_query = 19; + * + * @return Whether the imageQuery field is set. + */ + public boolean hasImageQuery() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Raw image query.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery image_query = 19; + * + * @return The imageQuery. + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery getImageQuery() { + if (imageQueryBuilder_ == null) { + return imageQuery_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery.getDefaultInstance() + : imageQuery_; + } else { + return imageQueryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Raw image query.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery image_query = 19; + */ + public Builder setImageQuery( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery value) { + if (imageQueryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + imageQuery_ = value; + } else { + imageQueryBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Raw image query.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery image_query = 19; + */ + public Builder setImageQuery( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery.Builder builderForValue) { + if (imageQueryBuilder_ == null) { + imageQuery_ = builderForValue.build(); + } else { + imageQueryBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Raw image query.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery image_query = 19; + */ + public Builder mergeImageQuery( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery value) { + if (imageQueryBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && imageQuery_ != null + && imageQuery_ + != com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery + .getDefaultInstance()) { + getImageQueryBuilder().mergeFrom(value); + } else { + imageQuery_ = value; + } + } else { + imageQueryBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Raw image query.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery image_query = 19; + */ + public Builder clearImageQuery() { + bitField0_ = (bitField0_ & ~0x00000008); + imageQuery_ = null; + if (imageQueryBuilder_ != null) { + imageQueryBuilder_.dispose(); + imageQueryBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Raw image query.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery image_query = 19; + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery.Builder + getImageQueryBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getImageQueryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Raw image query.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery image_query = 19; + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQueryOrBuilder + getImageQueryOrBuilder() { + if (imageQueryBuilder_ != null) { + return imageQueryBuilder_.getMessageOrBuilder(); + } else { + return imageQuery_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery.getDefaultInstance() + : imageQuery_; + } + } + /** + * + * + *
+     * Raw image query.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery image_query = 19; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQueryOrBuilder> + getImageQueryFieldBuilder() { + if (imageQueryBuilder_ == null) { + imageQueryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQueryOrBuilder>( + getImageQuery(), getParentForChildren(), isClean()); + imageQuery_ = null; + } + return imageQueryBuilder_; + } + + private int pageSize_; + /** + * + * + *
+     * Maximum number of
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s to return. If
+     * unspecified, defaults to a reasonable value. The maximum allowed value is
+     * 100. Values above 100 are coerced to 100.
+     *
+     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+     * 
+ * + * int32 page_size = 4; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s to return. If
+     * unspecified, defaults to a reasonable value. The maximum allowed value is
+     * 100. Values above 100 are coerced to 100.
+     *
+     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+     * 
+ * + * int32 page_size = 4; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s to return. If
+     * unspecified, defaults to a reasonable value. The maximum allowed value is
+     * 100. Values above 100 are coerced to 100.
+     *
+     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+     * 
+ * + * int32 page_size = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000010); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token received from a previous
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * must match the call that provided the page token. Otherwise, an
+     *  `INVALID_ARGUMENT`  error is returned.
+     * 
+ * + * string page_token = 5; + * + * @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 received from a previous
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * must match the call that provided the page token. Otherwise, an
+     *  `INVALID_ARGUMENT`  error is returned.
+     * 
+ * + * string page_token = 5; + * + * @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 received from a previous
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * must match the call that provided the page token. Otherwise, an
+     *  `INVALID_ARGUMENT`  error is returned.
+     * 
+ * + * string page_token = 5; + * + * @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; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token received from a previous
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * must match the call that provided the page token. Otherwise, an
+     *  `INVALID_ARGUMENT`  error is returned.
+     * 
+ * + * string page_token = 5; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token received from a previous
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * must match the call that provided the page token. Otherwise, an
+     *  `INVALID_ARGUMENT`  error is returned.
+     * 
+ * + * string page_token = 5; + * + * @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; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private int offset_; + /** + * + * + *
+     * A 0-indexed integer that specifies the current offset (that is, starting
+     * result location, amongst the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s deemed by the
+     * API as relevant) in search results. This field is only considered if
+     * [page_token][google.cloud.discoveryengine.v1alpha.SearchRequest.page_token]
+     * is unset.
+     *
+     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+     * 
+ * + * int32 offset = 6; + * + * @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
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s deemed by the
+     * API as relevant) in search results. This field is only considered if
+     * [page_token][google.cloud.discoveryengine.v1alpha.SearchRequest.page_token]
+     * is unset.
+     *
+     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+     * 
+ * + * int32 offset = 6; + * + * @param value The offset to set. + * @return This builder for chaining. + */ + public Builder setOffset(int value) { + + offset_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * A 0-indexed integer that specifies the current offset (that is, starting
+     * result location, amongst the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document]s deemed by the
+     * API as relevant) in search results. This field is only considered if
+     * [page_token][google.cloud.discoveryengine.v1alpha.SearchRequest.page_token]
+     * is unset.
+     *
+     * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+     * 
+ * + * int32 offset = 6; + * + * @return This builder for chaining. + */ + public Builder clearOffset() { + bitField0_ = (bitField0_ & ~0x00000040); + 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 documents being filtered. Filter
+     * expression is case-sensitive.
+     *
+     * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
+     * 
+ * + * string filter = 7; + * + * @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 documents being filtered. Filter
+     * expression is case-sensitive.
+     *
+     * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
+     * 
+ * + * string filter = 7; + * + * @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 documents being filtered. Filter
+     * expression is case-sensitive.
+     *
+     * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
+     * 
+ * + * string filter = 7; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the documents being filtered. Filter
+     * expression is case-sensitive.
+     *
+     * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
+     * 
+ * + * string filter = 7; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the documents being filtered. Filter
+     * expression is case-sensitive.
+     *
+     * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
+     * 
+ * + * string filter = 7; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * The order in which documents are returned. Documents can be ordered by
+     * a field in an [Document][google.cloud.discoveryengine.v1alpha.Document]
+     * object. Leave it unset if ordered by relevance. `order_by` expression is
+     * case-sensitive.
+     *
+     * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
+     * 
+ * + * string order_by = 8; + * + * @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 documents are returned. Documents can be ordered by
+     * a field in an [Document][google.cloud.discoveryengine.v1alpha.Document]
+     * object. Leave it unset if ordered by relevance. `order_by` expression is
+     * case-sensitive.
+     *
+     * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
+     * 
+ * + * string order_by = 8; + * + * @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 documents are returned. Documents can be ordered by
+     * a field in an [Document][google.cloud.discoveryengine.v1alpha.Document]
+     * object. Leave it unset if ordered by relevance. `order_by` expression is
+     * case-sensitive.
+     *
+     * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
+     * 
+ * + * string order_by = 8; + * + * @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; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * The order in which documents are returned. Documents can be ordered by
+     * a field in an [Document][google.cloud.discoveryengine.v1alpha.Document]
+     * object. Leave it unset if ordered by relevance. `order_by` expression is
+     * case-sensitive.
+     *
+     * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
+     * 
+ * + * string order_by = 8; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + /** + * + * + *
+     * The order in which documents are returned. Documents can be ordered by
+     * a field in an [Document][google.cloud.discoveryengine.v1alpha.Document]
+     * object. Leave it unset if ordered by relevance. `order_by` expression is
+     * case-sensitive.
+     *
+     * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
+     * 
+ * + * string order_by = 8; + * + * @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; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1alpha.UserInfo userInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.UserInfo, + com.google.cloud.discoveryengine.v1alpha.UserInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.UserInfoOrBuilder> + userInfoBuilder_; + /** + * + * + *
+     * Information about the end user.
+     * Highly recommended for analytics.
+     * [UserInfo.user_agent][google.cloud.discoveryengine.v1alpha.UserInfo.user_agent]
+     * is used to deduce `device_type` for analytics.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 21; + * + * @return Whether the userInfo field is set. + */ + public boolean hasUserInfo() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * + * + *
+     * Information about the end user.
+     * Highly recommended for analytics.
+     * [UserInfo.user_agent][google.cloud.discoveryengine.v1alpha.UserInfo.user_agent]
+     * is used to deduce `device_type` for analytics.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 21; + * + * @return The userInfo. + */ + public com.google.cloud.discoveryengine.v1alpha.UserInfo getUserInfo() { + if (userInfoBuilder_ == null) { + return userInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.UserInfo.getDefaultInstance() + : userInfo_; + } else { + return userInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Information about the end user.
+     * Highly recommended for analytics.
+     * [UserInfo.user_agent][google.cloud.discoveryengine.v1alpha.UserInfo.user_agent]
+     * is used to deduce `device_type` for analytics.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 21; + */ + public Builder setUserInfo(com.google.cloud.discoveryengine.v1alpha.UserInfo value) { + if (userInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userInfo_ = value; + } else { + userInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Information about the end user.
+     * Highly recommended for analytics.
+     * [UserInfo.user_agent][google.cloud.discoveryengine.v1alpha.UserInfo.user_agent]
+     * is used to deduce `device_type` for analytics.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 21; + */ + public Builder setUserInfo( + com.google.cloud.discoveryengine.v1alpha.UserInfo.Builder builderForValue) { + if (userInfoBuilder_ == null) { + userInfo_ = builderForValue.build(); + } else { + userInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Information about the end user.
+     * Highly recommended for analytics.
+     * [UserInfo.user_agent][google.cloud.discoveryengine.v1alpha.UserInfo.user_agent]
+     * is used to deduce `device_type` for analytics.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 21; + */ + public Builder mergeUserInfo(com.google.cloud.discoveryengine.v1alpha.UserInfo value) { + if (userInfoBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && userInfo_ != null + && userInfo_ + != com.google.cloud.discoveryengine.v1alpha.UserInfo.getDefaultInstance()) { + getUserInfoBuilder().mergeFrom(value); + } else { + userInfo_ = value; + } + } else { + userInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Information about the end user.
+     * Highly recommended for analytics.
+     * [UserInfo.user_agent][google.cloud.discoveryengine.v1alpha.UserInfo.user_agent]
+     * is used to deduce `device_type` for analytics.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 21; + */ + public Builder clearUserInfo() { + bitField0_ = (bitField0_ & ~0x00000200); + userInfo_ = null; + if (userInfoBuilder_ != null) { + userInfoBuilder_.dispose(); + userInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Information about the end user.
+     * Highly recommended for analytics.
+     * [UserInfo.user_agent][google.cloud.discoveryengine.v1alpha.UserInfo.user_agent]
+     * is used to deduce `device_type` for analytics.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 21; + */ + public com.google.cloud.discoveryengine.v1alpha.UserInfo.Builder getUserInfoBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getUserInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Information about the end user.
+     * Highly recommended for analytics.
+     * [UserInfo.user_agent][google.cloud.discoveryengine.v1alpha.UserInfo.user_agent]
+     * is used to deduce `device_type` for analytics.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 21; + */ + public com.google.cloud.discoveryengine.v1alpha.UserInfoOrBuilder getUserInfoOrBuilder() { + if (userInfoBuilder_ != null) { + return userInfoBuilder_.getMessageOrBuilder(); + } else { + return userInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.UserInfo.getDefaultInstance() + : userInfo_; + } + } + /** + * + * + *
+     * Information about the end user.
+     * Highly recommended for analytics.
+     * [UserInfo.user_agent][google.cloud.discoveryengine.v1alpha.UserInfo.user_agent]
+     * is used to deduce `device_type` for analytics.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 21; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.UserInfo, + com.google.cloud.discoveryengine.v1alpha.UserInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.UserInfoOrBuilder> + getUserInfoFieldBuilder() { + if (userInfoBuilder_ == null) { + userInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.UserInfo, + com.google.cloud.discoveryengine.v1alpha.UserInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.UserInfoOrBuilder>( + getUserInfo(), getParentForChildren(), isClean()); + userInfo_ = null; + } + return userInfoBuilder_; + } + + private java.util.List + facetSpecs_ = java.util.Collections.emptyList(); + + private void ensureFacetSpecsIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + facetSpecs_ = + new java.util.ArrayList< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec>(facetSpecs_); + bitField0_ |= 0x00000400; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + 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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + 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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + public com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + public Builder setFacetSpecs( + int index, com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + public Builder setFacetSpecs( + int index, + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + public Builder addFacetSpecs( + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + public Builder addFacetSpecs( + int index, com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + public Builder addFacetSpecs( + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + public Builder addFacetSpecs( + int index, + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + public Builder addAllFacetSpecs( + java.lang.Iterable< + ? extends com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec> + 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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + public Builder clearFacetSpecs() { + if (facetSpecsBuilder_ == null) { + facetSpecs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + 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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + 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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + public com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + public com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + public java.util.List< + ? extends com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.Builder + addFacetSpecsBuilder() { + return getFacetSpecsFieldBuilder() + .addBuilder( + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.Builder + addFacetSpecsBuilder(int index) { + return getFacetSpecsFieldBuilder() + .addBuilder( + index, + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + public java.util.List + getFacetSpecsBuilderList() { + return getFacetSpecsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpecOrBuilder> + getFacetSpecsFieldBuilder() { + if (facetSpecsBuilder_ == null) { + facetSpecsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpecOrBuilder>( + facetSpecs_, ((bitField0_ & 0x00000400) != 0), getParentForChildren(), isClean()); + facetSpecs_ = null; + } + return facetSpecsBuilder_; + } + + private com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec boostSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpecOrBuilder> + boostSpecBuilder_; + /** + * + * + *
+     * Boost specification to boost certain documents.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec boost_spec = 10; + * + * @return Whether the boostSpec field is set. + */ + public boolean hasBoostSpec() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * + * + *
+     * Boost specification to boost certain documents.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec boost_spec = 10; + * + * @return The boostSpec. + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec getBoostSpec() { + if (boostSpecBuilder_ == null) { + return boostSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.getDefaultInstance() + : boostSpec_; + } else { + return boostSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Boost specification to boost certain documents.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec boost_spec = 10; + */ + public Builder setBoostSpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec value) { + if (boostSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + boostSpec_ = value; + } else { + boostSpecBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Boost specification to boost certain documents.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec boost_spec = 10; + */ + public Builder setBoostSpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.Builder builderForValue) { + if (boostSpecBuilder_ == null) { + boostSpec_ = builderForValue.build(); + } else { + boostSpecBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Boost specification to boost certain documents.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec boost_spec = 10; + */ + public Builder mergeBoostSpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec value) { + if (boostSpecBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && boostSpec_ != null + && boostSpec_ + != com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec + .getDefaultInstance()) { + getBoostSpecBuilder().mergeFrom(value); + } else { + boostSpec_ = value; + } + } else { + boostSpecBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Boost specification to boost certain documents.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec boost_spec = 10; + */ + public Builder clearBoostSpec() { + bitField0_ = (bitField0_ & ~0x00000800); + boostSpec_ = null; + if (boostSpecBuilder_ != null) { + boostSpecBuilder_.dispose(); + boostSpecBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Boost specification to boost certain documents.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec boost_spec = 10; + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.Builder + getBoostSpecBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return getBoostSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Boost specification to boost certain documents.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec boost_spec = 10; + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpecOrBuilder + getBoostSpecOrBuilder() { + if (boostSpecBuilder_ != null) { + return boostSpecBuilder_.getMessageOrBuilder(); + } else { + return boostSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.getDefaultInstance() + : boostSpec_; + } + } + /** + * + * + *
+     * Boost specification to boost certain documents.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec boost_spec = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpecOrBuilder> + getBoostSpecFieldBuilder() { + if (boostSpecBuilder_ == null) { + boostSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpecOrBuilder>( + getBoostSpec(), getParentForChildren(), isClean()); + boostSpec_ = null; + } + return boostSpecBuilder_; + } + + 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() { + if (params_ == null) { + params_ = com.google.protobuf.MapField.newMapField(ParamsDefaultEntryHolder.defaultEntry); + } + if (!params_.isMutable()) { + params_ = params_.copy(); + } + bitField0_ |= 0x00001000; + onChanged(); + return params_; + } + + public int getParamsCount() { + return internalGetParams().getMap().size(); + } + /** + * + * + *
+     * Additional search parameters.
+     *
+     * For public website search only, supported values are:
+     *
+     * * `user_country_code`: string. Default empty. If set to non-empty, results
+     *    are restricted or boosted based on the location provided.
+     * * `search_type`: double. Default empty. Enables non-webpage searching
+     *   depending on the value. The only valid non-default value is 1,
+     *   which enables image searching.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 11; + */ + @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 search parameters.
+     *
+     * For public website search only, supported values are:
+     *
+     * * `user_country_code`: string. Default empty. If set to non-empty, results
+     *    are restricted or boosted based on the location provided.
+     * * `search_type`: double. Default empty. Enables non-webpage searching
+     *   depending on the value. The only valid non-default value is 1,
+     *   which enables image searching.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 11; + */ + @java.lang.Override + public java.util.Map getParamsMap() { + return internalGetParams().getMap(); + } + /** + * + * + *
+     * Additional search parameters.
+     *
+     * For public website search only, supported values are:
+     *
+     * * `user_country_code`: string. Default empty. If set to non-empty, results
+     *    are restricted or boosted based on the location provided.
+     * * `search_type`: double. Default empty. Enables non-webpage searching
+     *   depending on the value. The only valid non-default value is 1,
+     *   which enables image searching.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 11; + */ + @java.lang.Override + public /* nullable */ com.google.protobuf.Value getParamsOrDefault( + java.lang.String key, + /* nullable */ + 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 search parameters.
+     *
+     * For public website search only, supported values are:
+     *
+     * * `user_country_code`: string. Default empty. If set to non-empty, results
+     *    are restricted or boosted based on the location provided.
+     * * `search_type`: double. Default empty. Enables non-webpage searching
+     *   depending on the value. The only valid non-default value is 1,
+     *   which enables image searching.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 11; + */ + @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() { + bitField0_ = (bitField0_ & ~0x00001000); + internalGetMutableParams().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Additional search parameters.
+     *
+     * For public website search only, supported values are:
+     *
+     * * `user_country_code`: string. Default empty. If set to non-empty, results
+     *    are restricted or boosted based on the location provided.
+     * * `search_type`: double. Default empty. Enables non-webpage searching
+     *   depending on the value. The only valid non-default value is 1,
+     *   which enables image searching.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 11; + */ + 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() { + bitField0_ |= 0x00001000; + return internalGetMutableParams().getMutableMap(); + } + /** + * + * + *
+     * Additional search parameters.
+     *
+     * For public website search only, supported values are:
+     *
+     * * `user_country_code`: string. Default empty. If set to non-empty, results
+     *    are restricted or boosted based on the location provided.
+     * * `search_type`: double. Default empty. Enables non-webpage searching
+     *   depending on the value. The only valid non-default value is 1,
+     *   which enables image searching.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 11; + */ + 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); + bitField0_ |= 0x00001000; + return this; + } + /** + * + * + *
+     * Additional search parameters.
+     *
+     * For public website search only, supported values are:
+     *
+     * * `user_country_code`: string. Default empty. If set to non-empty, results
+     *    are restricted or boosted based on the location provided.
+     * * `search_type`: double. Default empty. Enables non-webpage searching
+     *   depending on the value. The only valid non-default value is 1,
+     *   which enables image searching.
+     * 
+ * + * map<string, .google.protobuf.Value> params = 11; + */ + public Builder putAllParams(java.util.Map values) { + internalGetMutableParams().getMutableMap().putAll(values); + bitField0_ |= 0x00001000; + return this; + } + + private com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec + queryExpansionSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpecOrBuilder> + queryExpansionSpecBuilder_; + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion occurs.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 13; + * + * + * @return Whether the queryExpansionSpec field is set. + */ + public boolean hasQueryExpansionSpec() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion occurs.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 13; + * + * + * @return The queryExpansionSpec. + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec + getQueryExpansionSpec() { + if (queryExpansionSpecBuilder_ == null) { + return queryExpansionSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec + .getDefaultInstance() + : queryExpansionSpec_; + } else { + return queryExpansionSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion occurs.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 13; + * + */ + public Builder setQueryExpansionSpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec value) { + if (queryExpansionSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryExpansionSpec_ = value; + } else { + queryExpansionSpecBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion occurs.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 13; + * + */ + public Builder setQueryExpansionSpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Builder + builderForValue) { + if (queryExpansionSpecBuilder_ == null) { + queryExpansionSpec_ = builderForValue.build(); + } else { + queryExpansionSpecBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion occurs.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 13; + * + */ + public Builder mergeQueryExpansionSpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec value) { + if (queryExpansionSpecBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) + && queryExpansionSpec_ != null + && queryExpansionSpec_ + != com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec + .getDefaultInstance()) { + getQueryExpansionSpecBuilder().mergeFrom(value); + } else { + queryExpansionSpec_ = value; + } + } else { + queryExpansionSpecBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion occurs.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 13; + * + */ + public Builder clearQueryExpansionSpec() { + bitField0_ = (bitField0_ & ~0x00002000); + queryExpansionSpec_ = null; + if (queryExpansionSpecBuilder_ != null) { + queryExpansionSpecBuilder_.dispose(); + queryExpansionSpecBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion occurs.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 13; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Builder + getQueryExpansionSpecBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getQueryExpansionSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion occurs.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 13; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpecOrBuilder + getQueryExpansionSpecOrBuilder() { + if (queryExpansionSpecBuilder_ != null) { + return queryExpansionSpecBuilder_.getMessageOrBuilder(); + } else { + return queryExpansionSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec + .getDefaultInstance() + : queryExpansionSpec_; + } + } + /** + * + * + *
+     * The query expansion specification that specifies the conditions under which
+     * query expansion occurs.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 13; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpecOrBuilder> + getQueryExpansionSpecFieldBuilder() { + if (queryExpansionSpecBuilder_ == null) { + queryExpansionSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpecOrBuilder>( + getQueryExpansionSpec(), getParentForChildren(), isClean()); + queryExpansionSpec_ = null; + } + return queryExpansionSpecBuilder_; + } + + private com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + spellCorrectionSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpecOrBuilder> + spellCorrectionSpecBuilder_; + /** + * + * + *
+     * The spell correction specification that specifies the mode under
+     * which spell correction takes effect.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14; + * + * + * @return Whether the spellCorrectionSpec field is set. + */ + public boolean hasSpellCorrectionSpec() { + return ((bitField0_ & 0x00004000) != 0); + } + /** + * + * + *
+     * The spell correction specification that specifies the mode under
+     * which spell correction takes effect.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14; + * + * + * @return The spellCorrectionSpec. + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + getSpellCorrectionSpec() { + if (spellCorrectionSpecBuilder_ == null) { + return spellCorrectionSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + .getDefaultInstance() + : spellCorrectionSpec_; + } else { + return spellCorrectionSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The spell correction specification that specifies the mode under
+     * which spell correction takes effect.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14; + * + */ + public Builder setSpellCorrectionSpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec value) { + if (spellCorrectionSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + spellCorrectionSpec_ = value; + } else { + spellCorrectionSpecBuilder_.setMessage(value); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * The spell correction specification that specifies the mode under
+     * which spell correction takes effect.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14; + * + */ + public Builder setSpellCorrectionSpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Builder + builderForValue) { + if (spellCorrectionSpecBuilder_ == null) { + spellCorrectionSpec_ = builderForValue.build(); + } else { + spellCorrectionSpecBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * The spell correction specification that specifies the mode under
+     * which spell correction takes effect.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14; + * + */ + public Builder mergeSpellCorrectionSpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec value) { + if (spellCorrectionSpecBuilder_ == null) { + if (((bitField0_ & 0x00004000) != 0) + && spellCorrectionSpec_ != null + && spellCorrectionSpec_ + != com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + .getDefaultInstance()) { + getSpellCorrectionSpecBuilder().mergeFrom(value); + } else { + spellCorrectionSpec_ = value; + } + } else { + spellCorrectionSpecBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * The spell correction specification that specifies the mode under
+     * which spell correction takes effect.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14; + * + */ + public Builder clearSpellCorrectionSpec() { + bitField0_ = (bitField0_ & ~0x00004000); + spellCorrectionSpec_ = null; + if (spellCorrectionSpecBuilder_ != null) { + spellCorrectionSpecBuilder_.dispose(); + spellCorrectionSpecBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The spell correction specification that specifies the mode under
+     * which spell correction takes effect.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Builder + getSpellCorrectionSpecBuilder() { + bitField0_ |= 0x00004000; + onChanged(); + return getSpellCorrectionSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The spell correction specification that specifies the mode under
+     * which spell correction takes effect.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpecOrBuilder + getSpellCorrectionSpecOrBuilder() { + if (spellCorrectionSpecBuilder_ != null) { + return spellCorrectionSpecBuilder_.getMessageOrBuilder(); + } else { + return spellCorrectionSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + .getDefaultInstance() + : spellCorrectionSpec_; + } + } + /** + * + * + *
+     * The spell correction specification that specifies the mode under
+     * which spell correction takes effect.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpecOrBuilder> + getSpellCorrectionSpecFieldBuilder() { + if (spellCorrectionSpecBuilder_ == null) { + spellCorrectionSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest + .SpellCorrectionSpecOrBuilder>( + getSpellCorrectionSpec(), getParentForChildren(), isClean()); + spellCorrectionSpec_ = null; + } + return spellCorrectionSpecBuilder_; + } + + private java.lang.Object userPseudoId_ = ""; + /** + * + * + *
+     * 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 field should NOT have a fixed value such as `unknown_visitor`.
+     *
+     * This should be the same identifier as
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * and
+     * [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1alpha.CompleteQueryRequest.user_pseudo_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_pseudo_id = 15; + * + * @return The userPseudoId. + */ + public java.lang.String getUserPseudoId() { + java.lang.Object ref = userPseudoId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userPseudoId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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 field should NOT have a fixed value such as `unknown_visitor`.
+     *
+     * This should be the same identifier as
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * and
+     * [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1alpha.CompleteQueryRequest.user_pseudo_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_pseudo_id = 15; + * + * @return The bytes for userPseudoId. + */ + public com.google.protobuf.ByteString getUserPseudoIdBytes() { + java.lang.Object ref = userPseudoId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userPseudoId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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 field should NOT have a fixed value such as `unknown_visitor`.
+     *
+     * This should be the same identifier as
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * and
+     * [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1alpha.CompleteQueryRequest.user_pseudo_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_pseudo_id = 15; + * + * @param value The userPseudoId to set. + * @return This builder for chaining. + */ + public Builder setUserPseudoId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + userPseudoId_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * 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 field should NOT have a fixed value such as `unknown_visitor`.
+     *
+     * This should be the same identifier as
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * and
+     * [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1alpha.CompleteQueryRequest.user_pseudo_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_pseudo_id = 15; + * + * @return This builder for chaining. + */ + public Builder clearUserPseudoId() { + userPseudoId_ = getDefaultInstance().getUserPseudoId(); + bitField0_ = (bitField0_ & ~0x00008000); + onChanged(); + return this; + } + /** + * + * + *
+     * 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 field should NOT have a fixed value such as `unknown_visitor`.
+     *
+     * This should be the same identifier as
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * and
+     * [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1alpha.CompleteQueryRequest.user_pseudo_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_pseudo_id = 15; + * + * @param value The bytes for userPseudoId to set. + * @return This builder for chaining. + */ + public Builder setUserPseudoIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + userPseudoId_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + contentSearchSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpecOrBuilder> + contentSearchSpecBuilder_; + /** + * + * + *
+     * A specification for configuring the behavior of content search.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec content_search_spec = 24; + * + * + * @return Whether the contentSearchSpec field is set. + */ + public boolean hasContentSearchSpec() { + return ((bitField0_ & 0x00010000) != 0); + } + /** + * + * + *
+     * A specification for configuring the behavior of content search.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec content_search_spec = 24; + * + * + * @return The contentSearchSpec. + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + getContentSearchSpec() { + if (contentSearchSpecBuilder_ == null) { + return contentSearchSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .getDefaultInstance() + : contentSearchSpec_; + } else { + return contentSearchSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A specification for configuring the behavior of content search.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec content_search_spec = 24; + * + */ + public Builder setContentSearchSpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec value) { + if (contentSearchSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + contentSearchSpec_ = value; + } else { + contentSearchSpecBuilder_.setMessage(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * A specification for configuring the behavior of content search.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec content_search_spec = 24; + * + */ + public Builder setContentSearchSpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.Builder + builderForValue) { + if (contentSearchSpecBuilder_ == null) { + contentSearchSpec_ = builderForValue.build(); + } else { + contentSearchSpecBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * A specification for configuring the behavior of content search.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec content_search_spec = 24; + * + */ + public Builder mergeContentSearchSpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec value) { + if (contentSearchSpecBuilder_ == null) { + if (((bitField0_ & 0x00010000) != 0) + && contentSearchSpec_ != null + && contentSearchSpec_ + != com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .getDefaultInstance()) { + getContentSearchSpecBuilder().mergeFrom(value); + } else { + contentSearchSpec_ = value; + } + } else { + contentSearchSpecBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * A specification for configuring the behavior of content search.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec content_search_spec = 24; + * + */ + public Builder clearContentSearchSpec() { + bitField0_ = (bitField0_ & ~0x00010000); + contentSearchSpec_ = null; + if (contentSearchSpecBuilder_ != null) { + contentSearchSpecBuilder_.dispose(); + contentSearchSpecBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * A specification for configuring the behavior of content search.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec content_search_spec = 24; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.Builder + getContentSearchSpecBuilder() { + bitField0_ |= 0x00010000; + onChanged(); + return getContentSearchSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A specification for configuring the behavior of content search.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec content_search_spec = 24; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpecOrBuilder + getContentSearchSpecOrBuilder() { + if (contentSearchSpecBuilder_ != null) { + return contentSearchSpecBuilder_.getMessageOrBuilder(); + } else { + return contentSearchSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + .getDefaultInstance() + : contentSearchSpec_; + } + } + /** + * + * + *
+     * A specification for configuring the behavior of content search.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec content_search_spec = 24; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpecOrBuilder> + getContentSearchSpecFieldBuilder() { + if (contentSearchSpecBuilder_ == null) { + contentSearchSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpecOrBuilder>( + getContentSearchSpec(), getParentForChildren(), isClean()); + contentSearchSpec_ = null; + } + return contentSearchSpecBuilder_; + } + + private com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec embeddingSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpecOrBuilder> + embeddingSpecBuilder_; + /** + * + * + *
+     * Uses the provided embedding to do additional semantic document retrieval.
+     * The retrieval is based on the dot product of
+     * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+     * embedding that is provided in
+     * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+     *
+     * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+     * provided, it will use [ServingConfig.embedding_config.field_paths][].
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + * + * @return Whether the embeddingSpec field is set. + */ + public boolean hasEmbeddingSpec() { + return ((bitField0_ & 0x00020000) != 0); + } + /** + * + * + *
+     * Uses the provided embedding to do additional semantic document retrieval.
+     * The retrieval is based on the dot product of
+     * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+     * embedding that is provided in
+     * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+     *
+     * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+     * provided, it will use [ServingConfig.embedding_config.field_paths][].
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + * + * @return The embeddingSpec. + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec getEmbeddingSpec() { + if (embeddingSpecBuilder_ == null) { + return embeddingSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .getDefaultInstance() + : embeddingSpec_; + } else { + return embeddingSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Uses the provided embedding to do additional semantic document retrieval.
+     * The retrieval is based on the dot product of
+     * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+     * embedding that is provided in
+     * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+     *
+     * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+     * provided, it will use [ServingConfig.embedding_config.field_paths][].
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + */ + public Builder setEmbeddingSpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec value) { + if (embeddingSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + embeddingSpec_ = value; + } else { + embeddingSpecBuilder_.setMessage(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * Uses the provided embedding to do additional semantic document retrieval.
+     * The retrieval is based on the dot product of
+     * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+     * embedding that is provided in
+     * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+     *
+     * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+     * provided, it will use [ServingConfig.embedding_config.field_paths][].
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + */ + public Builder setEmbeddingSpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.Builder + builderForValue) { + if (embeddingSpecBuilder_ == null) { + embeddingSpec_ = builderForValue.build(); + } else { + embeddingSpecBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * Uses the provided embedding to do additional semantic document retrieval.
+     * The retrieval is based on the dot product of
+     * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+     * embedding that is provided in
+     * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+     *
+     * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+     * provided, it will use [ServingConfig.embedding_config.field_paths][].
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + */ + public Builder mergeEmbeddingSpec( + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec value) { + if (embeddingSpecBuilder_ == null) { + if (((bitField0_ & 0x00020000) != 0) + && embeddingSpec_ != null + && embeddingSpec_ + != com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .getDefaultInstance()) { + getEmbeddingSpecBuilder().mergeFrom(value); + } else { + embeddingSpec_ = value; + } + } else { + embeddingSpecBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * Uses the provided embedding to do additional semantic document retrieval.
+     * The retrieval is based on the dot product of
+     * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+     * embedding that is provided in
+     * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+     *
+     * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+     * provided, it will use [ServingConfig.embedding_config.field_paths][].
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + */ + public Builder clearEmbeddingSpec() { + bitField0_ = (bitField0_ & ~0x00020000); + embeddingSpec_ = null; + if (embeddingSpecBuilder_ != null) { + embeddingSpecBuilder_.dispose(); + embeddingSpecBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Uses the provided embedding to do additional semantic document retrieval.
+     * The retrieval is based on the dot product of
+     * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+     * embedding that is provided in
+     * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+     *
+     * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+     * provided, it will use [ServingConfig.embedding_config.field_paths][].
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.Builder + getEmbeddingSpecBuilder() { + bitField0_ |= 0x00020000; + onChanged(); + return getEmbeddingSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Uses the provided embedding to do additional semantic document retrieval.
+     * The retrieval is based on the dot product of
+     * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+     * embedding that is provided in
+     * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+     *
+     * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+     * provided, it will use [ServingConfig.embedding_config.field_paths][].
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpecOrBuilder + getEmbeddingSpecOrBuilder() { + if (embeddingSpecBuilder_ != null) { + return embeddingSpecBuilder_.getMessageOrBuilder(); + } else { + return embeddingSpec_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec + .getDefaultInstance() + : embeddingSpec_; + } + } + /** + * + * + *
+     * Uses the provided embedding to do additional semantic document retrieval.
+     * The retrieval is based on the dot product of
+     * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+     * embedding that is provided in
+     * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+     *
+     * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+     * provided, it will use [ServingConfig.embedding_config.field_paths][].
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpecOrBuilder> + getEmbeddingSpecFieldBuilder() { + if (embeddingSpecBuilder_ == null) { + embeddingSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpecOrBuilder>( + getEmbeddingSpec(), getParentForChildren(), isClean()); + embeddingSpec_ = null; + } + return embeddingSpecBuilder_; + } + + private java.lang.Object rankingExpression_ = ""; + /** + * + * + *
+     * The ranking expression controls the customized ranking on retrieval
+     * documents. This overrides
+     * [ServingConfig.ranking_expression][google.cloud.discoveryengine.v1alpha.ServingConfig.ranking_expression].
+     * The ranking expression is a single function or multiple functions that are
+     * joint by "+".
+     *   * ranking_expression = function, { " + ", function };
+     * Supported functions:
+     *   * double * relevance_score
+     *   * double * dotProduct(embedding_field_path)
+     * Function variables:
+     *   `relevance_score`: pre-defined keywords, used for measure relevance
+     *   between query and document.
+     *   `embedding_field_path`: the document embedding field
+     *   used with query embedding vector.
+     *   `dotProduct`: embedding function between embedding_field_path and query
+     *   embedding vector.
+     *
+     *  Example ranking expression:
+     *    If document has an embedding field doc_embedding, the ranking expression
+     *    could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
+     * 
+ * + * string ranking_expression = 26; + * + * @return The rankingExpression. + */ + public java.lang.String getRankingExpression() { + java.lang.Object ref = rankingExpression_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + rankingExpression_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ranking expression controls the customized ranking on retrieval
+     * documents. This overrides
+     * [ServingConfig.ranking_expression][google.cloud.discoveryengine.v1alpha.ServingConfig.ranking_expression].
+     * The ranking expression is a single function or multiple functions that are
+     * joint by "+".
+     *   * ranking_expression = function, { " + ", function };
+     * Supported functions:
+     *   * double * relevance_score
+     *   * double * dotProduct(embedding_field_path)
+     * Function variables:
+     *   `relevance_score`: pre-defined keywords, used for measure relevance
+     *   between query and document.
+     *   `embedding_field_path`: the document embedding field
+     *   used with query embedding vector.
+     *   `dotProduct`: embedding function between embedding_field_path and query
+     *   embedding vector.
+     *
+     *  Example ranking expression:
+     *    If document has an embedding field doc_embedding, the ranking expression
+     *    could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
+     * 
+ * + * string ranking_expression = 26; + * + * @return The bytes for rankingExpression. + */ + public com.google.protobuf.ByteString getRankingExpressionBytes() { + java.lang.Object ref = rankingExpression_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rankingExpression_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ranking expression controls the customized ranking on retrieval
+     * documents. This overrides
+     * [ServingConfig.ranking_expression][google.cloud.discoveryengine.v1alpha.ServingConfig.ranking_expression].
+     * The ranking expression is a single function or multiple functions that are
+     * joint by "+".
+     *   * ranking_expression = function, { " + ", function };
+     * Supported functions:
+     *   * double * relevance_score
+     *   * double * dotProduct(embedding_field_path)
+     * Function variables:
+     *   `relevance_score`: pre-defined keywords, used for measure relevance
+     *   between query and document.
+     *   `embedding_field_path`: the document embedding field
+     *   used with query embedding vector.
+     *   `dotProduct`: embedding function between embedding_field_path and query
+     *   embedding vector.
+     *
+     *  Example ranking expression:
+     *    If document has an embedding field doc_embedding, the ranking expression
+     *    could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
+     * 
+ * + * string ranking_expression = 26; + * + * @param value The rankingExpression to set. + * @return This builder for chaining. + */ + public Builder setRankingExpression(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + rankingExpression_ = value; + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * The ranking expression controls the customized ranking on retrieval
+     * documents. This overrides
+     * [ServingConfig.ranking_expression][google.cloud.discoveryengine.v1alpha.ServingConfig.ranking_expression].
+     * The ranking expression is a single function or multiple functions that are
+     * joint by "+".
+     *   * ranking_expression = function, { " + ", function };
+     * Supported functions:
+     *   * double * relevance_score
+     *   * double * dotProduct(embedding_field_path)
+     * Function variables:
+     *   `relevance_score`: pre-defined keywords, used for measure relevance
+     *   between query and document.
+     *   `embedding_field_path`: the document embedding field
+     *   used with query embedding vector.
+     *   `dotProduct`: embedding function between embedding_field_path and query
+     *   embedding vector.
+     *
+     *  Example ranking expression:
+     *    If document has an embedding field doc_embedding, the ranking expression
+     *    could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
+     * 
+ * + * string ranking_expression = 26; + * + * @return This builder for chaining. + */ + public Builder clearRankingExpression() { + rankingExpression_ = getDefaultInstance().getRankingExpression(); + bitField0_ = (bitField0_ & ~0x00040000); + onChanged(); + return this; + } + /** + * + * + *
+     * The ranking expression controls the customized ranking on retrieval
+     * documents. This overrides
+     * [ServingConfig.ranking_expression][google.cloud.discoveryengine.v1alpha.ServingConfig.ranking_expression].
+     * The ranking expression is a single function or multiple functions that are
+     * joint by "+".
+     *   * ranking_expression = function, { " + ", function };
+     * Supported functions:
+     *   * double * relevance_score
+     *   * double * dotProduct(embedding_field_path)
+     * Function variables:
+     *   `relevance_score`: pre-defined keywords, used for measure relevance
+     *   between query and document.
+     *   `embedding_field_path`: the document embedding field
+     *   used with query embedding vector.
+     *   `dotProduct`: embedding function between embedding_field_path and query
+     *   embedding vector.
+     *
+     *  Example ranking expression:
+     *    If document has an embedding field doc_embedding, the ranking expression
+     *    could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
+     * 
+ * + * string ranking_expression = 26; + * + * @param value The bytes for rankingExpression to set. + * @return This builder for chaining. + */ + public Builder setRankingExpressionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + rankingExpression_ = value; + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + + private boolean safeSearch_; + /** + * + * + *
+     * Whether to turn on safe search. This is only supported for
+     * website search.
+     * 
+ * + * bool safe_search = 20; + * + * @return The safeSearch. + */ + @java.lang.Override + public boolean getSafeSearch() { + return safeSearch_; + } + /** + * + * + *
+     * Whether to turn on safe search. This is only supported for
+     * website search.
+     * 
+ * + * bool safe_search = 20; + * + * @param value The safeSearch to set. + * @return This builder for chaining. + */ + public Builder setSafeSearch(boolean value) { + + safeSearch_ = value; + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether to turn on safe search. This is only supported for
+     * website search.
+     * 
+ * + * bool safe_search = 20; + * + * @return This builder for chaining. + */ + public Builder clearSafeSearch() { + bitField0_ = (bitField0_ & ~0x00080000); + safeSearch_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.MapField userLabels_; + + private com.google.protobuf.MapField + internalGetUserLabels() { + if (userLabels_ == null) { + return com.google.protobuf.MapField.emptyMapField( + UserLabelsDefaultEntryHolder.defaultEntry); + } + return userLabels_; + } + + private com.google.protobuf.MapField + internalGetMutableUserLabels() { + if (userLabels_ == null) { + userLabels_ = + com.google.protobuf.MapField.newMapField(UserLabelsDefaultEntryHolder.defaultEntry); + } + if (!userLabels_.isMutable()) { + userLabels_ = userLabels_.copy(); + } + bitField0_ |= 0x00100000; + onChanged(); + return userLabels_; + } + + public int getUserLabelsCount() { + return internalGetUserLabels().getMap().size(); + } + /** + * + * + *
+     * The user 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> user_labels = 22; + */ + @java.lang.Override + public boolean containsUserLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetUserLabels().getMap().containsKey(key); + } + /** Use {@link #getUserLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getUserLabels() { + return getUserLabelsMap(); + } + /** + * + * + *
+     * The user 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> user_labels = 22; + */ + @java.lang.Override + public java.util.Map getUserLabelsMap() { + return internalGetUserLabels().getMap(); + } + /** + * + * + *
+     * The user 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> user_labels = 22; + */ + @java.lang.Override + public /* nullable */ java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The user 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> user_labels = 22; + */ + @java.lang.Override + public java.lang.String getUserLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetUserLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearUserLabels() { + bitField0_ = (bitField0_ & ~0x00100000); + internalGetMutableUserLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * The user 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> user_labels = 22; + */ + public Builder removeUserLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableUserLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableUserLabels() { + bitField0_ |= 0x00100000; + return internalGetMutableUserLabels().getMutableMap(); + } + /** + * + * + *
+     * The user 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> user_labels = 22; + */ + public Builder putUserLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableUserLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00100000; + return this; + } + /** + * + * + *
+     * The user 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> user_labels = 22; + */ + public Builder putAllUserLabels(java.util.Map values) { + internalGetMutableUserLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00100000; + 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.discoveryengine.v1alpha.SearchRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchRequest) + private static final com.google.cloud.discoveryengine.v1alpha.SearchRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.SearchRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchRequestOrBuilder.java new file mode 100644 index 000000000000..e58596511348 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchRequestOrBuilder.java @@ -0,0 +1,1010 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/search_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface SearchRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Search serving config, such as
+   * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
+   * This field is used to identify the serving configuration name, set
+   * of models used to make the search.
+   * 
+ * + * + * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The servingConfig. + */ + java.lang.String getServingConfig(); + /** + * + * + *
+   * Required. The resource name of the Search serving config, such as
+   * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
+   * This field is used to identify the serving configuration name, set
+   * of models used to make the search.
+   * 
+ * + * + * string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for servingConfig. + */ + com.google.protobuf.ByteString getServingConfigBytes(); + + /** + * + * + *
+   * The branch resource name, such as
+   * `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`.
+   *
+   * Use `default_branch` as the branch ID or leave this field empty, to search
+   * documents 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/collections/default_collection/dataStores/default_data_store/branches/0`.
+   *
+   * Use `default_branch` as the branch ID or leave this field empty, to search
+   * documents 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(); + + /** + * + * + *
+   * Raw image query.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery image_query = 19; + * + * @return Whether the imageQuery field is set. + */ + boolean hasImageQuery(); + /** + * + * + *
+   * Raw image query.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery image_query = 19; + * + * @return The imageQuery. + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery getImageQuery(); + /** + * + * + *
+   * Raw image query.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQuery image_query = 19; + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ImageQueryOrBuilder + getImageQueryOrBuilder(); + + /** + * + * + *
+   * Maximum number of
+   * [Document][google.cloud.discoveryengine.v1alpha.Document]s to return. If
+   * unspecified, defaults to a reasonable value. The maximum allowed value is
+   * 100. Values above 100 are coerced to 100.
+   *
+   * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+   * 
+ * + * int32 page_size = 4; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token received from a previous
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+   * call. Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+   * must match the call that provided the page token. Otherwise, an
+   *  `INVALID_ARGUMENT`  error is returned.
+   * 
+ * + * string page_token = 5; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token received from a previous
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+   * call. Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+   * must match the call that provided the page token. Otherwise, an
+   *  `INVALID_ARGUMENT`  error is returned.
+   * 
+ * + * string page_token = 5; + * + * @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
+   * [Document][google.cloud.discoveryengine.v1alpha.Document]s deemed by the
+   * API as relevant) in search results. This field is only considered if
+   * [page_token][google.cloud.discoveryengine.v1alpha.SearchRequest.page_token]
+   * is unset.
+   *
+   * If this field is negative, an  `INVALID_ARGUMENT`  is returned.
+   * 
+ * + * int32 offset = 6; + * + * @return The offset. + */ + int getOffset(); + + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the documents being filtered. Filter
+   * expression is case-sensitive.
+   *
+   * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
+   * 
+ * + * string filter = 7; + * + * @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 documents being filtered. Filter
+   * expression is case-sensitive.
+   *
+   * If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
+   * 
+ * + * string filter = 7; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * The order in which documents are returned. Documents can be ordered by
+   * a field in an [Document][google.cloud.discoveryengine.v1alpha.Document]
+   * object. Leave it unset if ordered by relevance. `order_by` expression is
+   * case-sensitive.
+   *
+   * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
+   * 
+ * + * string order_by = 8; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * The order in which documents are returned. Documents can be ordered by
+   * a field in an [Document][google.cloud.discoveryengine.v1alpha.Document]
+   * object. Leave it unset if ordered by relevance. `order_by` expression is
+   * case-sensitive.
+   *
+   * If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
+   * 
+ * + * string order_by = 8; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+   * Information about the end user.
+   * Highly recommended for analytics.
+   * [UserInfo.user_agent][google.cloud.discoveryengine.v1alpha.UserInfo.user_agent]
+   * is used to deduce `device_type` for analytics.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 21; + * + * @return Whether the userInfo field is set. + */ + boolean hasUserInfo(); + /** + * + * + *
+   * Information about the end user.
+   * Highly recommended for analytics.
+   * [UserInfo.user_agent][google.cloud.discoveryengine.v1alpha.UserInfo.user_agent]
+   * is used to deduce `device_type` for analytics.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 21; + * + * @return The userInfo. + */ + com.google.cloud.discoveryengine.v1alpha.UserInfo getUserInfo(); + /** + * + * + *
+   * Information about the end user.
+   * Highly recommended for analytics.
+   * [UserInfo.user_agent][google.cloud.discoveryengine.v1alpha.UserInfo.user_agent]
+   * is used to deduce `device_type` for analytics.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 21; + */ + com.google.cloud.discoveryengine.v1alpha.UserInfoOrBuilder getUserInfoOrBuilder(); + + /** + * + * + *
+   * 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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + 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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + 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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + java.util.List< + ? extends com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpecOrBuilder> + 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.discoveryengine.v1alpha.SearchRequest.FacetSpec facet_specs = 9; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpecOrBuilder getFacetSpecsOrBuilder( + int index); + + /** + * + * + *
+   * Boost specification to boost certain documents.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec boost_spec = 10; + * + * @return Whether the boostSpec field is set. + */ + boolean hasBoostSpec(); + /** + * + * + *
+   * Boost specification to boost certain documents.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec boost_spec = 10; + * + * @return The boostSpec. + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec getBoostSpec(); + /** + * + * + *
+   * Boost specification to boost certain documents.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec boost_spec = 10; + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpecOrBuilder getBoostSpecOrBuilder(); + + /** + * + * + *
+   * Additional search parameters.
+   *
+   * For public website search only, supported values are:
+   *
+   * * `user_country_code`: string. Default empty. If set to non-empty, results
+   *    are restricted or boosted based on the location provided.
+   * * `search_type`: double. Default empty. Enables non-webpage searching
+   *   depending on the value. The only valid non-default value is 1,
+   *   which enables image searching.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 11; + */ + int getParamsCount(); + /** + * + * + *
+   * Additional search parameters.
+   *
+   * For public website search only, supported values are:
+   *
+   * * `user_country_code`: string. Default empty. If set to non-empty, results
+   *    are restricted or boosted based on the location provided.
+   * * `search_type`: double. Default empty. Enables non-webpage searching
+   *   depending on the value. The only valid non-default value is 1,
+   *   which enables image searching.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 11; + */ + boolean containsParams(java.lang.String key); + /** Use {@link #getParamsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getParams(); + /** + * + * + *
+   * Additional search parameters.
+   *
+   * For public website search only, supported values are:
+   *
+   * * `user_country_code`: string. Default empty. If set to non-empty, results
+   *    are restricted or boosted based on the location provided.
+   * * `search_type`: double. Default empty. Enables non-webpage searching
+   *   depending on the value. The only valid non-default value is 1,
+   *   which enables image searching.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 11; + */ + java.util.Map getParamsMap(); + /** + * + * + *
+   * Additional search parameters.
+   *
+   * For public website search only, supported values are:
+   *
+   * * `user_country_code`: string. Default empty. If set to non-empty, results
+   *    are restricted or boosted based on the location provided.
+   * * `search_type`: double. Default empty. Enables non-webpage searching
+   *   depending on the value. The only valid non-default value is 1,
+   *   which enables image searching.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 11; + */ + /* nullable */ + com.google.protobuf.Value getParamsOrDefault( + java.lang.String key, + /* nullable */ + com.google.protobuf.Value defaultValue); + /** + * + * + *
+   * Additional search parameters.
+   *
+   * For public website search only, supported values are:
+   *
+   * * `user_country_code`: string. Default empty. If set to non-empty, results
+   *    are restricted or boosted based on the location provided.
+   * * `search_type`: double. Default empty. Enables non-webpage searching
+   *   depending on the value. The only valid non-default value is 1,
+   *   which enables image searching.
+   * 
+ * + * map<string, .google.protobuf.Value> params = 11; + */ + com.google.protobuf.Value getParamsOrThrow(java.lang.String key); + + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion occurs.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 13; + * + * + * @return Whether the queryExpansionSpec field is set. + */ + boolean hasQueryExpansionSpec(); + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion occurs.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 13; + * + * + * @return The queryExpansionSpec. + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec getQueryExpansionSpec(); + /** + * + * + *
+   * The query expansion specification that specifies the conditions under which
+   * query expansion occurs.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec query_expansion_spec = 13; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpecOrBuilder + getQueryExpansionSpecOrBuilder(); + + /** + * + * + *
+   * The spell correction specification that specifies the mode under
+   * which spell correction takes effect.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14; + * + * + * @return Whether the spellCorrectionSpec field is set. + */ + boolean hasSpellCorrectionSpec(); + /** + * + * + *
+   * The spell correction specification that specifies the mode under
+   * which spell correction takes effect.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14; + * + * + * @return The spellCorrectionSpec. + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec + getSpellCorrectionSpec(); + /** + * + * + *
+   * The spell correction specification that specifies the mode under
+   * which spell correction takes effect.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec spell_correction_spec = 14; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpecOrBuilder + getSpellCorrectionSpecOrBuilder(); + + /** + * + * + *
+   * 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 field should NOT have a fixed value such as `unknown_visitor`.
+   *
+   * This should be the same identifier as
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * and
+   * [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1alpha.CompleteQueryRequest.user_pseudo_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_pseudo_id = 15; + * + * @return The userPseudoId. + */ + java.lang.String getUserPseudoId(); + /** + * + * + *
+   * 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 field should NOT have a fixed value such as `unknown_visitor`.
+   *
+   * This should be the same identifier as
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * and
+   * [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1alpha.CompleteQueryRequest.user_pseudo_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_pseudo_id = 15; + * + * @return The bytes for userPseudoId. + */ + com.google.protobuf.ByteString getUserPseudoIdBytes(); + + /** + * + * + *
+   * A specification for configuring the behavior of content search.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec content_search_spec = 24; + * + * + * @return Whether the contentSearchSpec field is set. + */ + boolean hasContentSearchSpec(); + /** + * + * + *
+   * A specification for configuring the behavior of content search.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec content_search_spec = 24; + * + * + * @return The contentSearchSpec. + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec getContentSearchSpec(); + /** + * + * + *
+   * A specification for configuring the behavior of content search.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec content_search_spec = 24; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpecOrBuilder + getContentSearchSpecOrBuilder(); + + /** + * + * + *
+   * Uses the provided embedding to do additional semantic document retrieval.
+   * The retrieval is based on the dot product of
+   * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+   * embedding that is provided in
+   * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+   *
+   * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+   * provided, it will use [ServingConfig.embedding_config.field_paths][].
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + * + * @return Whether the embeddingSpec field is set. + */ + boolean hasEmbeddingSpec(); + /** + * + * + *
+   * Uses the provided embedding to do additional semantic document retrieval.
+   * The retrieval is based on the dot product of
+   * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+   * embedding that is provided in
+   * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+   *
+   * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+   * provided, it will use [ServingConfig.embedding_config.field_paths][].
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + * + * @return The embeddingSpec. + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec getEmbeddingSpec(); + /** + * + * + *
+   * Uses the provided embedding to do additional semantic document retrieval.
+   * The retrieval is based on the dot product of
+   * [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
+   * embedding that is provided in
+   * [SearchRequest.embedding_spec.embedding_vectors.field_path][].
+   *
+   * If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
+   * provided, it will use [ServingConfig.embedding_config.field_paths][].
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec embedding_spec = 23; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpecOrBuilder + getEmbeddingSpecOrBuilder(); + + /** + * + * + *
+   * The ranking expression controls the customized ranking on retrieval
+   * documents. This overrides
+   * [ServingConfig.ranking_expression][google.cloud.discoveryengine.v1alpha.ServingConfig.ranking_expression].
+   * The ranking expression is a single function or multiple functions that are
+   * joint by "+".
+   *   * ranking_expression = function, { " + ", function };
+   * Supported functions:
+   *   * double * relevance_score
+   *   * double * dotProduct(embedding_field_path)
+   * Function variables:
+   *   `relevance_score`: pre-defined keywords, used for measure relevance
+   *   between query and document.
+   *   `embedding_field_path`: the document embedding field
+   *   used with query embedding vector.
+   *   `dotProduct`: embedding function between embedding_field_path and query
+   *   embedding vector.
+   *
+   *  Example ranking expression:
+   *    If document has an embedding field doc_embedding, the ranking expression
+   *    could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
+   * 
+ * + * string ranking_expression = 26; + * + * @return The rankingExpression. + */ + java.lang.String getRankingExpression(); + /** + * + * + *
+   * The ranking expression controls the customized ranking on retrieval
+   * documents. This overrides
+   * [ServingConfig.ranking_expression][google.cloud.discoveryengine.v1alpha.ServingConfig.ranking_expression].
+   * The ranking expression is a single function or multiple functions that are
+   * joint by "+".
+   *   * ranking_expression = function, { " + ", function };
+   * Supported functions:
+   *   * double * relevance_score
+   *   * double * dotProduct(embedding_field_path)
+   * Function variables:
+   *   `relevance_score`: pre-defined keywords, used for measure relevance
+   *   between query and document.
+   *   `embedding_field_path`: the document embedding field
+   *   used with query embedding vector.
+   *   `dotProduct`: embedding function between embedding_field_path and query
+   *   embedding vector.
+   *
+   *  Example ranking expression:
+   *    If document has an embedding field doc_embedding, the ranking expression
+   *    could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
+   * 
+ * + * string ranking_expression = 26; + * + * @return The bytes for rankingExpression. + */ + com.google.protobuf.ByteString getRankingExpressionBytes(); + + /** + * + * + *
+   * Whether to turn on safe search. This is only supported for
+   * website search.
+   * 
+ * + * bool safe_search = 20; + * + * @return The safeSearch. + */ + boolean getSafeSearch(); + + /** + * + * + *
+   * The user 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> user_labels = 22; + */ + int getUserLabelsCount(); + /** + * + * + *
+   * The user 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> user_labels = 22; + */ + boolean containsUserLabels(java.lang.String key); + /** Use {@link #getUserLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getUserLabels(); + /** + * + * + *
+   * The user 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> user_labels = 22; + */ + java.util.Map getUserLabelsMap(); + /** + * + * + *
+   * The user 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> user_labels = 22; + */ + /* nullable */ + java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * The user 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> user_labels = 22; + */ + java.lang.String getUserLabelsOrThrow(java.lang.String key); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchResponse.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchResponse.java new file mode 100644 index 000000000000..eeb429acf90f --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchResponse.java @@ -0,0 +1,15113 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/search_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Response message for
+ * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchResponse} + */ +public final class SearchResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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(); + attributionToken_ = ""; + redirectUri_ = ""; + nextPageToken_ = ""; + correctedQuery_ = ""; + appliedControls_ = com.google.protobuf.LazyStringArrayList.emptyList(); + geoSearchDebugInfo_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.class, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Builder.class); + } + + public interface SearchResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] of the
+     * searched [Document][google.cloud.discoveryengine.v1alpha.Document].
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+     * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] of the
+     * searched [Document][google.cloud.discoveryengine.v1alpha.Document].
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+     * The document data snippet in the search response. Only fields that are
+     * marked as retrievable are populated.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + * + * @return Whether the document field is set. + */ + boolean hasDocument(); + /** + * + * + *
+     * The document data snippet in the search response. Only fields that are
+     * marked as retrievable are populated.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + * + * @return The document. + */ + com.google.cloud.discoveryengine.v1alpha.Document getDocument(); + /** + * + * + *
+     * The document data snippet in the search response. Only fields that are
+     * marked as retrievable are populated.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + */ + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder getDocumentOrBuilder(); + + /** + * + * + *
+     * Google provided available scores.
+     * 
+ * + * map<string, .google.cloud.discoveryengine.v1alpha.DoubleList> model_scores = 4; + * + */ + int getModelScoresCount(); + /** + * + * + *
+     * Google provided available scores.
+     * 
+ * + * map<string, .google.cloud.discoveryengine.v1alpha.DoubleList> model_scores = 4; + * + */ + boolean containsModelScores(java.lang.String key); + /** Use {@link #getModelScoresMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getModelScores(); + /** + * + * + *
+     * Google provided available scores.
+     * 
+ * + * map<string, .google.cloud.discoveryengine.v1alpha.DoubleList> model_scores = 4; + * + */ + java.util.Map + getModelScoresMap(); + /** + * + * + *
+     * Google provided available scores.
+     * 
+ * + * map<string, .google.cloud.discoveryengine.v1alpha.DoubleList> model_scores = 4; + * + */ + /* nullable */ + com.google.cloud.discoveryengine.v1alpha.DoubleList getModelScoresOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.discoveryengine.v1alpha.DoubleList defaultValue); + /** + * + * + *
+     * Google provided available scores.
+     * 
+ * + * map<string, .google.cloud.discoveryengine.v1alpha.DoubleList> model_scores = 4; + * + */ + com.google.cloud.discoveryengine.v1alpha.DoubleList getModelScoresOrThrow(java.lang.String key); + } + /** + * + * + *
+   * Represents the search results.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult} + */ + public static final class SearchResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_SearchResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetModelScores(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_SearchResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.class, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * + * + *
+     * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] of the
+     * searched [Document][google.cloud.discoveryengine.v1alpha.Document].
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] of the
+     * searched [Document][google.cloud.discoveryengine.v1alpha.Document].
+     * 
+ * + * 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 DOCUMENT_FIELD_NUMBER = 2; + private com.google.cloud.discoveryengine.v1alpha.Document document_; + /** + * + * + *
+     * The document data snippet in the search response. Only fields that are
+     * marked as retrievable are populated.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + * + * @return Whether the document field is set. + */ + @java.lang.Override + public boolean hasDocument() { + return document_ != null; + } + /** + * + * + *
+     * The document data snippet in the search response. Only fields that are
+     * marked as retrievable are populated.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + * + * @return The document. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Document getDocument() { + return document_ == null + ? com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance() + : document_; + } + /** + * + * + *
+     * The document data snippet in the search response. Only fields that are
+     * marked as retrievable are populated.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder getDocumentOrBuilder() { + return document_ == null + ? com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance() + : document_; + } + + public static final int MODEL_SCORES_FIELD_NUMBER = 4; + + private static final class ModelScoresDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.discoveryengine.v1alpha.DoubleList> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_SearchResult_ModelScoresEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.discoveryengine.v1alpha.DoubleList.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.discoveryengine.v1alpha.DoubleList> + modelScores_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.discoveryengine.v1alpha.DoubleList> + internalGetModelScores() { + if (modelScores_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ModelScoresDefaultEntryHolder.defaultEntry); + } + return modelScores_; + } + + public int getModelScoresCount() { + return internalGetModelScores().getMap().size(); + } + /** + * + * + *
+     * Google provided available scores.
+     * 
+ * + * map<string, .google.cloud.discoveryengine.v1alpha.DoubleList> model_scores = 4; + * + */ + @java.lang.Override + public boolean containsModelScores(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetModelScores().getMap().containsKey(key); + } + /** Use {@link #getModelScoresMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getModelScores() { + return getModelScoresMap(); + } + /** + * + * + *
+     * Google provided available scores.
+     * 
+ * + * map<string, .google.cloud.discoveryengine.v1alpha.DoubleList> model_scores = 4; + * + */ + @java.lang.Override + public java.util.Map + getModelScoresMap() { + return internalGetModelScores().getMap(); + } + /** + * + * + *
+     * Google provided available scores.
+     * 
+ * + * map<string, .google.cloud.discoveryengine.v1alpha.DoubleList> model_scores = 4; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.discoveryengine.v1alpha.DoubleList + getModelScoresOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.discoveryengine.v1alpha.DoubleList defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetModelScores().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Google provided available scores.
+     * 
+ * + * map<string, .google.cloud.discoveryengine.v1alpha.DoubleList> model_scores = 4; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DoubleList getModelScoresOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetModelScores().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 (document_ != null) { + output.writeMessage(2, getDocument()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetModelScores(), ModelScoresDefaultEntryHolder.defaultEntry, 4); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (document_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDocument()); + } + for (java.util.Map.Entry< + java.lang.String, com.google.cloud.discoveryengine.v1alpha.DoubleList> + entry : internalGetModelScores().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.discoveryengine.v1alpha.DoubleList> + modelScores__ = + ModelScoresDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, modelScores__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult other = + (com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult) obj; + + if (!getId().equals(other.getId())) return false; + if (hasDocument() != other.hasDocument()) return false; + if (hasDocument()) { + if (!getDocument().equals(other.getDocument())) return false; + } + if (!internalGetModelScores().equals(other.internalGetModelScores())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + if (hasDocument()) { + hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getDocument().hashCode(); + } + if (!internalGetModelScores().getMap().isEmpty()) { + hash = (37 * hash) + MODEL_SCORES_FIELD_NUMBER; + hash = (53 * hash) + internalGetModelScores().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.SearchResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.SearchResult parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.SearchResult parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.SearchResult + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.SearchResult} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult) + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_SearchResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetModelScores(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableModelScores(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_SearchResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.class, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + document_ = null; + if (documentBuilder_ != null) { + documentBuilder_.dispose(); + documentBuilder_ = null; + } + internalGetMutableModelScores().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_SearchResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult build() { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult result = + new com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.document_ = documentBuilder_ == null ? document_ : documentBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.modelScores_ = internalGetModelScores(); + result.modelScores_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult + .getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasDocument()) { + mergeDocument(other.getDocument()); + } + internalGetMutableModelScores().mergeFrom(other.internalGetModelScores()); + bitField0_ |= 0x00000004; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 34: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.discoveryengine.v1alpha.DoubleList> + modelScores__ = + input.readMessage( + ModelScoresDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableModelScores() + .getMutableMap() + .put(modelScores__.getKey(), modelScores__.getValue()); + bitField0_ |= 0x00000004; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * + * + *
+       * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] of the
+       * searched [Document][google.cloud.discoveryengine.v1alpha.Document].
+       * 
+ * + * 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; + } + } + /** + * + * + *
+       * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] of the
+       * searched [Document][google.cloud.discoveryengine.v1alpha.Document].
+       * 
+ * + * 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; + } + } + /** + * + * + *
+       * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] of the
+       * searched [Document][google.cloud.discoveryengine.v1alpha.Document].
+       * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] of the
+       * searched [Document][google.cloud.discoveryengine.v1alpha.Document].
+       * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] of the
+       * searched [Document][google.cloud.discoveryengine.v1alpha.Document].
+       * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1alpha.Document document_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Document, + com.google.cloud.discoveryengine.v1alpha.Document.Builder, + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder> + documentBuilder_; + /** + * + * + *
+       * The document data snippet in the search response. Only fields that are
+       * marked as retrievable are populated.
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + * + * @return Whether the document field is set. + */ + public boolean hasDocument() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * The document data snippet in the search response. Only fields that are
+       * marked as retrievable are populated.
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + * + * @return The document. + */ + public com.google.cloud.discoveryengine.v1alpha.Document getDocument() { + if (documentBuilder_ == null) { + return document_ == null + ? com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance() + : document_; + } else { + return documentBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The document data snippet in the search response. Only fields that are
+       * marked as retrievable are populated.
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + */ + public Builder setDocument(com.google.cloud.discoveryengine.v1alpha.Document value) { + if (documentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + document_ = value; + } else { + documentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The document data snippet in the search response. Only fields that are
+       * marked as retrievable are populated.
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + */ + public Builder setDocument( + com.google.cloud.discoveryengine.v1alpha.Document.Builder builderForValue) { + if (documentBuilder_ == null) { + document_ = builderForValue.build(); + } else { + documentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The document data snippet in the search response. Only fields that are
+       * marked as retrievable are populated.
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + */ + public Builder mergeDocument(com.google.cloud.discoveryengine.v1alpha.Document value) { + if (documentBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && document_ != null + && document_ + != com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance()) { + getDocumentBuilder().mergeFrom(value); + } else { + document_ = value; + } + } else { + documentBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The document data snippet in the search response. Only fields that are
+       * marked as retrievable are populated.
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + */ + public Builder clearDocument() { + bitField0_ = (bitField0_ & ~0x00000002); + document_ = null; + if (documentBuilder_ != null) { + documentBuilder_.dispose(); + documentBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * The document data snippet in the search response. Only fields that are
+       * marked as retrievable are populated.
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.Document.Builder getDocumentBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getDocumentFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The document data snippet in the search response. Only fields that are
+       * marked as retrievable are populated.
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder getDocumentOrBuilder() { + if (documentBuilder_ != null) { + return documentBuilder_.getMessageOrBuilder(); + } else { + return document_ == null + ? com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance() + : document_; + } + } + /** + * + * + *
+       * The document data snippet in the search response. Only fields that are
+       * marked as retrievable are populated.
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Document document = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Document, + com.google.cloud.discoveryengine.v1alpha.Document.Builder, + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder> + getDocumentFieldBuilder() { + if (documentBuilder_ == null) { + documentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Document, + com.google.cloud.discoveryengine.v1alpha.Document.Builder, + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder>( + getDocument(), getParentForChildren(), isClean()); + document_ = null; + } + return documentBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.discoveryengine.v1alpha.DoubleList> + modelScores_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.discoveryengine.v1alpha.DoubleList> + internalGetModelScores() { + if (modelScores_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ModelScoresDefaultEntryHolder.defaultEntry); + } + return modelScores_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.discoveryengine.v1alpha.DoubleList> + internalGetMutableModelScores() { + if (modelScores_ == null) { + modelScores_ = + com.google.protobuf.MapField.newMapField(ModelScoresDefaultEntryHolder.defaultEntry); + } + if (!modelScores_.isMutable()) { + modelScores_ = modelScores_.copy(); + } + bitField0_ |= 0x00000004; + onChanged(); + return modelScores_; + } + + public int getModelScoresCount() { + return internalGetModelScores().getMap().size(); + } + /** + * + * + *
+       * Google provided available scores.
+       * 
+ * + * map<string, .google.cloud.discoveryengine.v1alpha.DoubleList> model_scores = 4; + * + */ + @java.lang.Override + public boolean containsModelScores(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetModelScores().getMap().containsKey(key); + } + /** Use {@link #getModelScoresMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getModelScores() { + return getModelScoresMap(); + } + /** + * + * + *
+       * Google provided available scores.
+       * 
+ * + * map<string, .google.cloud.discoveryengine.v1alpha.DoubleList> model_scores = 4; + * + */ + @java.lang.Override + public java.util.Map + getModelScoresMap() { + return internalGetModelScores().getMap(); + } + /** + * + * + *
+       * Google provided available scores.
+       * 
+ * + * map<string, .google.cloud.discoveryengine.v1alpha.DoubleList> model_scores = 4; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.discoveryengine.v1alpha.DoubleList + getModelScoresOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.discoveryengine.v1alpha.DoubleList defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetModelScores().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+       * Google provided available scores.
+       * 
+ * + * map<string, .google.cloud.discoveryengine.v1alpha.DoubleList> model_scores = 4; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DoubleList getModelScoresOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetModelScores().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearModelScores() { + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableModelScores().getMutableMap().clear(); + return this; + } + /** + * + * + *
+       * Google provided available scores.
+       * 
+ * + * map<string, .google.cloud.discoveryengine.v1alpha.DoubleList> model_scores = 4; + * + */ + public Builder removeModelScores(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableModelScores().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableModelScores() { + bitField0_ |= 0x00000004; + return internalGetMutableModelScores().getMutableMap(); + } + /** + * + * + *
+       * Google provided available scores.
+       * 
+ * + * map<string, .google.cloud.discoveryengine.v1alpha.DoubleList> model_scores = 4; + * + */ + public Builder putModelScores( + java.lang.String key, com.google.cloud.discoveryengine.v1alpha.DoubleList value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableModelScores().getMutableMap().put(key, value); + bitField0_ |= 0x00000004; + return this; + } + /** + * + * + *
+       * Google provided available scores.
+       * 
+ * + * map<string, .google.cloud.discoveryengine.v1alpha.DoubleList> model_scores = 4; + * + */ + public Builder putAllModelScores( + java.util.Map + values) { + internalGetMutableModelScores().getMutableMap().putAll(values); + bitField0_ |= 0x00000004; + 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.discoveryengine.v1alpha.SearchResponse.SearchResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult) + private static final com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface FacetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchResponse.Facet) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The key for this facet. E.g., "colors" or "price". It matches
+     * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key].
+     * 
+ * + * string key = 1; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+     * The key for this facet. E.g., "colors" or "price". It matches
+     * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key].
+     * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + java.util.List + getValuesList(); + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue getValues(int index); + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + int getValuesCount(); + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValueOrBuilder> + getValuesOrBuilderList(); + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet} + */ + public static final class Facet extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Facet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Facet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.class, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.Builder.class); + } + + public interface FacetValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colors".
+       * 
+ * + * string value = 1; + * + * @return Whether the value field is set. + */ + boolean hasValue(); + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colors".
+       * 
+ * + * string value = 1; + * + * @return The value. + */ + java.lang.String getValue(); + /** + * + * + *
+       * Text value of a facet, such as "Black" for facet "colors".
+       * 
+ * + * 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". It
+       * matches
+       * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Interval interval = 2; + * + * @return Whether the interval field is set. + */ + boolean hasInterval(); + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price". It
+       * matches
+       * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Interval interval = 2; + * + * @return The interval. + */ + com.google.cloud.discoveryengine.v1alpha.Interval getInterval(); + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price". It
+       * matches
+       * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Interval interval = 2; + */ + com.google.cloud.discoveryengine.v1alpha.IntervalOrBuilder getIntervalOrBuilder(); + + /** + * + * + *
+       * Number of items that have this facet value.
+       * 
+ * + * int64 count = 3; + * + * @return The count. + */ + long getCount(); + + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.FacetValueCase + getFacetValueCase(); + } + /** + * + * + *
+     * A facet value which contains value names and their count.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue} + */ + public static final class FacetValue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Facet_FacetValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Facet_FacetValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.class, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.Builder + .class); + } + + private int facetValueCase_ = 0; + + @SuppressWarnings("serial") + 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 "colors".
+       * 
+ * + * 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 "colors".
+       * 
+ * + * 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 "colors".
+       * 
+ * + * 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". It
+       * matches
+       * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.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". It
+       * matches
+       * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Interval interval = 2; + * + * @return The interval. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Interval getInterval() { + if (facetValueCase_ == 2) { + return (com.google.cloud.discoveryengine.v1alpha.Interval) facetValue_; + } + return com.google.cloud.discoveryengine.v1alpha.Interval.getDefaultInstance(); + } + /** + * + * + *
+       * Interval value for a facet, such as [10, 20) for facet "price". It
+       * matches
+       * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+       * 
+ * + * .google.cloud.discoveryengine.v1alpha.Interval interval = 2; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.IntervalOrBuilder getIntervalOrBuilder() { + if (facetValueCase_ == 2) { + return (com.google.cloud.discoveryengine.v1alpha.Interval) facetValue_; + } + return com.google.cloud.discoveryengine.v1alpha.Interval.getDefaultInstance(); + } + + public static final int COUNT_FIELD_NUMBER = 3; + private long count_ = 0L; + /** + * + * + *
+       * 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.discoveryengine.v1alpha.Interval) facetValue_); + } + if (count_ != 0L) { + output.writeInt64(3, count_); + } + getUnknownFields().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.discoveryengine.v1alpha.Interval) facetValue_); + } + if (count_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, count_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue other = + (com.google.cloud.discoveryengine.v1alpha.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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue) + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Facet_FacetValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Facet_FacetValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.class, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.Builder + .class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (intervalBuilder_ != null) { + intervalBuilder_.clear(); + } + count_ = 0L; + facetValueCase_ = 0; + facetValue_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Facet_FacetValue_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue build() { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue + buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue result = + new com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.count_ = count_; + } + } + + private void buildPartialOneofs( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue result) { + result.facetValueCase_ = facetValueCase_; + result.facetValue_ = this.facetValue_; + if (facetValueCase_ == 2 && intervalBuilder_ != null) { + result.facetValue_ = intervalBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.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.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + facetValueCase_ = 1; + facetValue_ = s; + break; + } // case 10 + case 18: + { + input.readMessage(getIntervalFieldBuilder().getBuilder(), extensionRegistry); + facetValueCase_ = 2; + break; + } // case 18 + case 24: + { + count_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int facetValueCase_ = 0; + private java.lang.Object facetValue_; + + public FacetValueCase getFacetValueCase() { + return FacetValueCase.forNumber(facetValueCase_); + } + + public Builder clearFacetValue() { + facetValueCase_ = 0; + facetValue_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+         * Text value of a facet, such as "Black" for facet "colors".
+         * 
+ * + * 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 "colors".
+         * 
+ * + * 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 "colors".
+         * 
+ * + * 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 "colors".
+         * 
+ * + * 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 "colors".
+         * 
+ * + * 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 "colors".
+         * 
+ * + * 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.discoveryengine.v1alpha.Interval, + com.google.cloud.discoveryengine.v1alpha.Interval.Builder, + com.google.cloud.discoveryengine.v1alpha.IntervalOrBuilder> + intervalBuilder_; + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price". It
+         * matches
+         * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * .google.cloud.discoveryengine.v1alpha.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". It
+         * matches
+         * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * .google.cloud.discoveryengine.v1alpha.Interval interval = 2; + * + * @return The interval. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Interval getInterval() { + if (intervalBuilder_ == null) { + if (facetValueCase_ == 2) { + return (com.google.cloud.discoveryengine.v1alpha.Interval) facetValue_; + } + return com.google.cloud.discoveryengine.v1alpha.Interval.getDefaultInstance(); + } else { + if (facetValueCase_ == 2) { + return intervalBuilder_.getMessage(); + } + return com.google.cloud.discoveryengine.v1alpha.Interval.getDefaultInstance(); + } + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price". It
+         * matches
+         * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * .google.cloud.discoveryengine.v1alpha.Interval interval = 2; + */ + public Builder setInterval(com.google.cloud.discoveryengine.v1alpha.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". It
+         * matches
+         * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * .google.cloud.discoveryengine.v1alpha.Interval interval = 2; + */ + public Builder setInterval( + com.google.cloud.discoveryengine.v1alpha.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". It
+         * matches
+         * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * .google.cloud.discoveryengine.v1alpha.Interval interval = 2; + */ + public Builder mergeInterval(com.google.cloud.discoveryengine.v1alpha.Interval value) { + if (intervalBuilder_ == null) { + if (facetValueCase_ == 2 + && facetValue_ + != com.google.cloud.discoveryengine.v1alpha.Interval.getDefaultInstance()) { + facetValue_ = + com.google.cloud.discoveryengine.v1alpha.Interval.newBuilder( + (com.google.cloud.discoveryengine.v1alpha.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". It
+         * matches
+         * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * .google.cloud.discoveryengine.v1alpha.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". It
+         * matches
+         * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * .google.cloud.discoveryengine.v1alpha.Interval interval = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.Interval.Builder getIntervalBuilder() { + return getIntervalFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price". It
+         * matches
+         * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * .google.cloud.discoveryengine.v1alpha.Interval interval = 2; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.IntervalOrBuilder getIntervalOrBuilder() { + if ((facetValueCase_ == 2) && (intervalBuilder_ != null)) { + return intervalBuilder_.getMessageOrBuilder(); + } else { + if (facetValueCase_ == 2) { + return (com.google.cloud.discoveryengine.v1alpha.Interval) facetValue_; + } + return com.google.cloud.discoveryengine.v1alpha.Interval.getDefaultInstance(); + } + } + /** + * + * + *
+         * Interval value for a facet, such as [10, 20) for facet "price". It
+         * matches
+         * [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals].
+         * 
+ * + * .google.cloud.discoveryengine.v1alpha.Interval interval = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Interval, + com.google.cloud.discoveryengine.v1alpha.Interval.Builder, + com.google.cloud.discoveryengine.v1alpha.IntervalOrBuilder> + getIntervalFieldBuilder() { + if (intervalBuilder_ == null) { + if (!(facetValueCase_ == 2)) { + facetValue_ = com.google.cloud.discoveryengine.v1alpha.Interval.getDefaultInstance(); + } + intervalBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Interval, + com.google.cloud.discoveryengine.v1alpha.Interval.Builder, + com.google.cloud.discoveryengine.v1alpha.IntervalOrBuilder>( + (com.google.cloud.discoveryengine.v1alpha.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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+         * Number of items that have this facet value.
+         * 
+ * + * int64 count = 3; + * + * @return This builder for chaining. + */ + public Builder clearCount() { + bitField0_ = (bitField0_ & ~0x00000004); + 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.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue) + private static final com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int KEY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object key_ = ""; + /** + * + * + *
+     * The key for this facet. E.g., "colors" or "price". It matches
+     * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key].
+     * 
+ * + * 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., "colors" or "price". It matches
+     * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key].
+     * 
+ * + * 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; + + @SuppressWarnings("serial") + private java.util.List + values_; + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + @java.lang.Override + public java.util.List + getValuesList() { + return values_; + } + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValueOrBuilder> + getValuesOrBuilderList() { + return values_; + } + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + @java.lang.Override + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue getValues( + int index) { + return values_.get(index); + } + /** + * + * + *
+     * The facet values for this field.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValueOrBuilder + getValuesOrBuilder(int index) { + return values_.get(index); + } + + public static final int DYNAMIC_FACET_FIELD_NUMBER = 3; + private boolean dynamicFacet_ = false; + /** + * + * + *
+     * 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_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet other = + (com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet) obj; + + if (!getKey().equals(other.getKey())) return false; + if (!getValuesList().equals(other.getValuesList())) return false; + if (getDynamicFacet() != other.getDynamicFacet()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchResponse.Facet) + com.google.cloud.discoveryengine.v1alpha.SearchResponse.FacetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Facet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Facet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.class, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + key_ = ""; + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + } else { + values_ = null; + valuesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + dynamicFacet_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Facet_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet build() { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet result = + new com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet result) { + if (valuesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + values_ = java.util.Collections.unmodifiableList(values_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.values_ = values_; + } else { + result.values_ = valuesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.dynamicFacet_ = dynamicFacet_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.getDefaultInstance()) + return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (valuesBuilder_ == null) { + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + } else { + if (!other.values_.isEmpty()) { + if (valuesBuilder_.isEmpty()) { + valuesBuilder_.dispose(); + valuesBuilder_ = null; + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000002); + valuesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getValuesFieldBuilder() + : null; + } else { + valuesBuilder_.addAllMessages(other.values_); + } + } + } + if (other.getDynamicFacet() != false) { + setDynamicFacet(other.getDynamicFacet()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + key_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue + .parser(), + extensionRegistry); + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(m); + } else { + valuesBuilder_.addMessage(m); + } + break; + } // case 18 + case 24: + { + dynamicFacet_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * + * + *
+       * The key for this facet. E.g., "colors" or "price". It matches
+       * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key].
+       * 
+ * + * 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., "colors" or "price". It matches
+       * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key].
+       * 
+ * + * 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., "colors" or "price". It matches
+       * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key].
+       * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The key for this facet. E.g., "colors" or "price". It matches
+       * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key].
+       * 
+ * + * string key = 1; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + key_ = getDefaultInstance().getKey(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The key for this facet. E.g., "colors" or "price". It matches
+       * [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key].
+       * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue> + values_ = java.util.Collections.emptyList(); + + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + values_ = + new java.util.ArrayList< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue>( + values_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValueOrBuilder> + valuesBuilder_; + + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue> + getValuesList() { + if (valuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(values_); + } else { + return valuesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder setValues( + int index, + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder setValues( + int index, + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder addValues( + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder addValues( + int index, + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder addValues( + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder addValues( + int index, + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder addAllValues( + java.lang.Iterable< + ? extends + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public Builder clearValues() { + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + valuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.Builder + getValuesBuilder(int index) { + return getValuesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.Builder + addValuesBuilder() { + return getValuesFieldBuilder() + .addBuilder( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue + .getDefaultInstance()); + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.Builder + addValuesBuilder(int index) { + return getValuesFieldBuilder() + .addBuilder( + index, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue + .getDefaultInstance()); + } + /** + * + * + *
+       * The facet values for this field.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue values = 2; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.Builder> + getValuesBuilderList() { + return getValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValueOrBuilder> + getValuesFieldBuilder() { + if (valuesBuilder_ == null) { + valuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet + .FacetValueOrBuilder>( + values_, ((bitField0_ & 0x00000002) != 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Whether the facet is dynamically generated.
+       * 
+ * + * bool dynamic_facet = 3; + * + * @return This builder for chaining. + */ + public Builder clearDynamicFacet() { + bitField0_ = (bitField0_ & ~0x00000004); + 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.discoveryengine.v1alpha.SearchResponse.Facet) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchResponse.Facet) + private static final com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface GuidedSearchResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * A list of ranked refinement attributes.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute> + getRefinementAttributesList(); + /** + * + * + *
+     * A list of ranked refinement attributes.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute + getRefinementAttributes(int index); + /** + * + * + *
+     * A list of ranked refinement attributes.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + int getRefinementAttributesCount(); + /** + * + * + *
+     * A list of ranked refinement attributes.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttributeOrBuilder> + getRefinementAttributesOrBuilderList(); + /** + * + * + *
+     * A list of ranked refinement attributes.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttributeOrBuilder + getRefinementAttributesOrBuilder(int index); + + /** + * + * + *
+     * Suggested follow-up questions.
+     * 
+ * + * repeated string follow_up_questions = 2; + * + * @return A list containing the followUpQuestions. + */ + java.util.List getFollowUpQuestionsList(); + /** + * + * + *
+     * Suggested follow-up questions.
+     * 
+ * + * repeated string follow_up_questions = 2; + * + * @return The count of followUpQuestions. + */ + int getFollowUpQuestionsCount(); + /** + * + * + *
+     * Suggested follow-up questions.
+     * 
+ * + * repeated string follow_up_questions = 2; + * + * @param index The index of the element to return. + * @return The followUpQuestions at the given index. + */ + java.lang.String getFollowUpQuestions(int index); + /** + * + * + *
+     * Suggested follow-up questions.
+     * 
+ * + * repeated string follow_up_questions = 2; + * + * @param index The index of the value to return. + * @return The bytes of the followUpQuestions at the given index. + */ + com.google.protobuf.ByteString getFollowUpQuestionsBytes(int index); + } + /** + * + * + *
+   * Guided search result. The guided search helps user to refine the search
+   * results and narrow down to the real needs from a broaded search results.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult} + */ + public static final class GuidedSearchResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult) + GuidedSearchResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use GuidedSearchResult.newBuilder() to construct. + private GuidedSearchResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GuidedSearchResult() { + refinementAttributes_ = java.util.Collections.emptyList(); + followUpQuestions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GuidedSearchResult(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GuidedSearchResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GuidedSearchResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.class, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.Builder + .class); + } + + public interface RefinementAttributeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Attribute key used to refine the results e.g. 'movie_type'.
+       * 
+ * + * string attribute_key = 1; + * + * @return The attributeKey. + */ + java.lang.String getAttributeKey(); + /** + * + * + *
+       * Attribute key used to refine the results e.g. 'movie_type'.
+       * 
+ * + * string attribute_key = 1; + * + * @return The bytes for attributeKey. + */ + com.google.protobuf.ByteString getAttributeKeyBytes(); + + /** + * + * + *
+       * Attribute value used to refine the results e.g. 'drama'.
+       * 
+ * + * string attribute_value = 2; + * + * @return The attributeValue. + */ + java.lang.String getAttributeValue(); + /** + * + * + *
+       * Attribute value used to refine the results e.g. 'drama'.
+       * 
+ * + * string attribute_value = 2; + * + * @return The bytes for attributeValue. + */ + com.google.protobuf.ByteString getAttributeValueBytes(); + } + /** + * + * + *
+     * Useful attribute for search result refinements.
+     * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute} + */ + public static final class RefinementAttribute extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute) + RefinementAttributeOrBuilder { + private static final long serialVersionUID = 0L; + // Use RefinementAttribute.newBuilder() to construct. + private RefinementAttribute(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RefinementAttribute() { + attributeKey_ = ""; + attributeValue_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RefinementAttribute(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GuidedSearchResult_RefinementAttribute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GuidedSearchResult_RefinementAttribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute.class, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute.Builder.class); + } + + public static final int ATTRIBUTE_KEY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object attributeKey_ = ""; + /** + * + * + *
+       * Attribute key used to refine the results e.g. 'movie_type'.
+       * 
+ * + * string attribute_key = 1; + * + * @return The attributeKey. + */ + @java.lang.Override + public java.lang.String getAttributeKey() { + java.lang.Object ref = attributeKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attributeKey_ = s; + return s; + } + } + /** + * + * + *
+       * Attribute key used to refine the results e.g. 'movie_type'.
+       * 
+ * + * string attribute_key = 1; + * + * @return The bytes for attributeKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttributeKeyBytes() { + java.lang.Object ref = attributeKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributeKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTRIBUTE_VALUE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object attributeValue_ = ""; + /** + * + * + *
+       * Attribute value used to refine the results e.g. 'drama'.
+       * 
+ * + * string attribute_value = 2; + * + * @return The attributeValue. + */ + @java.lang.Override + public java.lang.String getAttributeValue() { + java.lang.Object ref = attributeValue_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attributeValue_ = s; + return s; + } + } + /** + * + * + *
+       * Attribute value used to refine the results e.g. 'drama'.
+       * 
+ * + * string attribute_value = 2; + * + * @return The bytes for attributeValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttributeValueBytes() { + java.lang.Object ref = attributeValue_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributeValue_ = 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(attributeKey_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, attributeKey_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributeValue_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, attributeValue_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributeKey_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, attributeKey_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributeValue_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, attributeValue_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + other = + (com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute) + obj; + + if (!getAttributeKey().equals(other.getAttributeKey())) return false; + if (!getAttributeValue().equals(other.getAttributeValue())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ATTRIBUTE_KEY_FIELD_NUMBER; + hash = (53 * hash) + getAttributeKey().hashCode(); + hash = (37 * hash) + ATTRIBUTE_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getAttributeValue().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * Useful attribute for search result refinements.
+       * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute) + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttributeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GuidedSearchResult_RefinementAttribute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GuidedSearchResult_RefinementAttribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute.class, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + attributeKey_ = ""; + attributeValue_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GuidedSearchResult_RefinementAttribute_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + build() { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + result = + new com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.attributeKey_ = attributeKey_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.attributeValue_ = attributeValue_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute.getDefaultInstance()) return this; + if (!other.getAttributeKey().isEmpty()) { + attributeKey_ = other.attributeKey_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAttributeValue().isEmpty()) { + attributeValue_ = other.attributeValue_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + attributeKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + attributeValue_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object attributeKey_ = ""; + /** + * + * + *
+         * Attribute key used to refine the results e.g. 'movie_type'.
+         * 
+ * + * string attribute_key = 1; + * + * @return The attributeKey. + */ + public java.lang.String getAttributeKey() { + java.lang.Object ref = attributeKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attributeKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Attribute key used to refine the results e.g. 'movie_type'.
+         * 
+ * + * string attribute_key = 1; + * + * @return The bytes for attributeKey. + */ + public com.google.protobuf.ByteString getAttributeKeyBytes() { + java.lang.Object ref = attributeKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributeKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Attribute key used to refine the results e.g. 'movie_type'.
+         * 
+ * + * string attribute_key = 1; + * + * @param value The attributeKey to set. + * @return This builder for chaining. + */ + public Builder setAttributeKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + attributeKey_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * Attribute key used to refine the results e.g. 'movie_type'.
+         * 
+ * + * string attribute_key = 1; + * + * @return This builder for chaining. + */ + public Builder clearAttributeKey() { + attributeKey_ = getDefaultInstance().getAttributeKey(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+         * Attribute key used to refine the results e.g. 'movie_type'.
+         * 
+ * + * string attribute_key = 1; + * + * @param value The bytes for attributeKey to set. + * @return This builder for chaining. + */ + public Builder setAttributeKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + attributeKey_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object attributeValue_ = ""; + /** + * + * + *
+         * Attribute value used to refine the results e.g. 'drama'.
+         * 
+ * + * string attribute_value = 2; + * + * @return The attributeValue. + */ + public java.lang.String getAttributeValue() { + java.lang.Object ref = attributeValue_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attributeValue_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Attribute value used to refine the results e.g. 'drama'.
+         * 
+ * + * string attribute_value = 2; + * + * @return The bytes for attributeValue. + */ + public com.google.protobuf.ByteString getAttributeValueBytes() { + java.lang.Object ref = attributeValue_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributeValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Attribute value used to refine the results e.g. 'drama'.
+         * 
+ * + * string attribute_value = 2; + * + * @param value The attributeValue to set. + * @return This builder for chaining. + */ + public Builder setAttributeValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + attributeValue_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * Attribute value used to refine the results e.g. 'drama'.
+         * 
+ * + * string attribute_value = 2; + * + * @return This builder for chaining. + */ + public Builder clearAttributeValue() { + attributeValue_ = getDefaultInstance().getAttributeValue(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+         * Attribute value used to refine the results e.g. 'drama'.
+         * 
+ * + * string attribute_value = 2; + * + * @param value The bytes for attributeValue to set. + * @return This builder for chaining. + */ + public Builder setAttributeValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + attributeValue_ = value; + bitField0_ |= 0x00000002; + 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.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute) + private static final com.google.cloud.discoveryengine.v1alpha.SearchResponse + .GuidedSearchResult.RefinementAttribute + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute(); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RefinementAttribute parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int REFINEMENT_ATTRIBUTES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute> + refinementAttributes_; + /** + * + * + *
+     * A list of ranked refinement attributes.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + @java.lang.Override + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute> + getRefinementAttributesList() { + return refinementAttributes_; + } + /** + * + * + *
+     * A list of ranked refinement attributes.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttributeOrBuilder> + getRefinementAttributesOrBuilderList() { + return refinementAttributes_; + } + /** + * + * + *
+     * A list of ranked refinement attributes.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + @java.lang.Override + public int getRefinementAttributesCount() { + return refinementAttributes_.size(); + } + /** + * + * + *
+     * A list of ranked refinement attributes.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + getRefinementAttributes(int index) { + return refinementAttributes_.get(index); + } + /** + * + * + *
+     * A list of ranked refinement attributes.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttributeOrBuilder + getRefinementAttributesOrBuilder(int index) { + return refinementAttributes_.get(index); + } + + public static final int FOLLOW_UP_QUESTIONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList followUpQuestions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+     * Suggested follow-up questions.
+     * 
+ * + * repeated string follow_up_questions = 2; + * + * @return A list containing the followUpQuestions. + */ + public com.google.protobuf.ProtocolStringList getFollowUpQuestionsList() { + return followUpQuestions_; + } + /** + * + * + *
+     * Suggested follow-up questions.
+     * 
+ * + * repeated string follow_up_questions = 2; + * + * @return The count of followUpQuestions. + */ + public int getFollowUpQuestionsCount() { + return followUpQuestions_.size(); + } + /** + * + * + *
+     * Suggested follow-up questions.
+     * 
+ * + * repeated string follow_up_questions = 2; + * + * @param index The index of the element to return. + * @return The followUpQuestions at the given index. + */ + public java.lang.String getFollowUpQuestions(int index) { + return followUpQuestions_.get(index); + } + /** + * + * + *
+     * Suggested follow-up questions.
+     * 
+ * + * repeated string follow_up_questions = 2; + * + * @param index The index of the value to return. + * @return The bytes of the followUpQuestions at the given index. + */ + public com.google.protobuf.ByteString getFollowUpQuestionsBytes(int index) { + return followUpQuestions_.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 < refinementAttributes_.size(); i++) { + output.writeMessage(1, refinementAttributes_.get(i)); + } + for (int i = 0; i < followUpQuestions_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, followUpQuestions_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < refinementAttributes_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, refinementAttributes_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < followUpQuestions_.size(); i++) { + dataSize += computeStringSizeNoTag(followUpQuestions_.getRaw(i)); + } + size += dataSize; + size += 1 * getFollowUpQuestionsList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult other = + (com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult) obj; + + if (!getRefinementAttributesList().equals(other.getRefinementAttributesList())) return false; + if (!getFollowUpQuestionsList().equals(other.getFollowUpQuestionsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRefinementAttributesCount() > 0) { + hash = (37 * hash) + REFINEMENT_ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + getRefinementAttributesList().hashCode(); + } + if (getFollowUpQuestionsCount() > 0) { + hash = (37 * hash) + FOLLOW_UP_QUESTIONS_FIELD_NUMBER; + hash = (53 * hash) + getFollowUpQuestionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Guided search result. The guided search helps user to refine the search
+     * results and narrow down to the real needs from a broaded search results.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult) + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GuidedSearchResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GuidedSearchResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.class, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.Builder + .class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (refinementAttributesBuilder_ == null) { + refinementAttributes_ = java.util.Collections.emptyList(); + } else { + refinementAttributes_ = null; + refinementAttributesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + followUpQuestions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GuidedSearchResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult build() { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult result = + new com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult result) { + if (refinementAttributesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + refinementAttributes_ = java.util.Collections.unmodifiableList(refinementAttributes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.refinementAttributes_ = refinementAttributes_; + } else { + result.refinementAttributes_ = refinementAttributesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + followUpQuestions_.makeImmutable(); + result.followUpQuestions_ = followUpQuestions_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .getDefaultInstance()) return this; + if (refinementAttributesBuilder_ == null) { + if (!other.refinementAttributes_.isEmpty()) { + if (refinementAttributes_.isEmpty()) { + refinementAttributes_ = other.refinementAttributes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRefinementAttributesIsMutable(); + refinementAttributes_.addAll(other.refinementAttributes_); + } + onChanged(); + } + } else { + if (!other.refinementAttributes_.isEmpty()) { + if (refinementAttributesBuilder_.isEmpty()) { + refinementAttributesBuilder_.dispose(); + refinementAttributesBuilder_ = null; + refinementAttributes_ = other.refinementAttributes_; + bitField0_ = (bitField0_ & ~0x00000001); + refinementAttributesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRefinementAttributesFieldBuilder() + : null; + } else { + refinementAttributesBuilder_.addAllMessages(other.refinementAttributes_); + } + } + } + if (!other.followUpQuestions_.isEmpty()) { + if (followUpQuestions_.isEmpty()) { + followUpQuestions_ = other.followUpQuestions_; + bitField0_ |= 0x00000002; + } else { + ensureFollowUpQuestionsIsMutable(); + followUpQuestions_.addAll(other.followUpQuestions_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.SearchResponse + .GuidedSearchResult.RefinementAttribute.parser(), + extensionRegistry); + if (refinementAttributesBuilder_ == null) { + ensureRefinementAttributesIsMutable(); + refinementAttributes_.add(m); + } else { + refinementAttributesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureFollowUpQuestionsIsMutable(); + followUpQuestions_.add(s); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute> + refinementAttributes_ = java.util.Collections.emptyList(); + + private void ensureRefinementAttributesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + refinementAttributes_ = + new java.util.ArrayList< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute>(refinementAttributes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttributeOrBuilder> + refinementAttributesBuilder_; + + /** + * + * + *
+       * A list of ranked refinement attributes.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute> + getRefinementAttributesList() { + if (refinementAttributesBuilder_ == null) { + return java.util.Collections.unmodifiableList(refinementAttributes_); + } else { + return refinementAttributesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * A list of ranked refinement attributes.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + public int getRefinementAttributesCount() { + if (refinementAttributesBuilder_ == null) { + return refinementAttributes_.size(); + } else { + return refinementAttributesBuilder_.getCount(); + } + } + /** + * + * + *
+       * A list of ranked refinement attributes.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + getRefinementAttributes(int index) { + if (refinementAttributesBuilder_ == null) { + return refinementAttributes_.get(index); + } else { + return refinementAttributesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * A list of ranked refinement attributes.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + public Builder setRefinementAttributes( + int index, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + value) { + if (refinementAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRefinementAttributesIsMutable(); + refinementAttributes_.set(index, value); + onChanged(); + } else { + refinementAttributesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * A list of ranked refinement attributes.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + public Builder setRefinementAttributes( + int index, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute.Builder + builderForValue) { + if (refinementAttributesBuilder_ == null) { + ensureRefinementAttributesIsMutable(); + refinementAttributes_.set(index, builderForValue.build()); + onChanged(); + } else { + refinementAttributesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * A list of ranked refinement attributes.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + public Builder addRefinementAttributes( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + value) { + if (refinementAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRefinementAttributesIsMutable(); + refinementAttributes_.add(value); + onChanged(); + } else { + refinementAttributesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * A list of ranked refinement attributes.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + public Builder addRefinementAttributes( + int index, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute + value) { + if (refinementAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRefinementAttributesIsMutable(); + refinementAttributes_.add(index, value); + onChanged(); + } else { + refinementAttributesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * A list of ranked refinement attributes.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + public Builder addRefinementAttributes( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute.Builder + builderForValue) { + if (refinementAttributesBuilder_ == null) { + ensureRefinementAttributesIsMutable(); + refinementAttributes_.add(builderForValue.build()); + onChanged(); + } else { + refinementAttributesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * A list of ranked refinement attributes.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + public Builder addRefinementAttributes( + int index, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute.Builder + builderForValue) { + if (refinementAttributesBuilder_ == null) { + ensureRefinementAttributesIsMutable(); + refinementAttributes_.add(index, builderForValue.build()); + onChanged(); + } else { + refinementAttributesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * A list of ranked refinement attributes.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + public Builder addAllRefinementAttributes( + java.lang.Iterable< + ? extends + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute> + values) { + if (refinementAttributesBuilder_ == null) { + ensureRefinementAttributesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, refinementAttributes_); + onChanged(); + } else { + refinementAttributesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * A list of ranked refinement attributes.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + public Builder clearRefinementAttributes() { + if (refinementAttributesBuilder_ == null) { + refinementAttributes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + refinementAttributesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * A list of ranked refinement attributes.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + public Builder removeRefinementAttributes(int index) { + if (refinementAttributesBuilder_ == null) { + ensureRefinementAttributesIsMutable(); + refinementAttributes_.remove(index); + onChanged(); + } else { + refinementAttributesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * A list of ranked refinement attributes.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute.Builder + getRefinementAttributesBuilder(int index) { + return getRefinementAttributesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * A list of ranked refinement attributes.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttributeOrBuilder + getRefinementAttributesOrBuilder(int index) { + if (refinementAttributesBuilder_ == null) { + return refinementAttributes_.get(index); + } else { + return refinementAttributesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * A list of ranked refinement attributes.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttributeOrBuilder> + getRefinementAttributesOrBuilderList() { + if (refinementAttributesBuilder_ != null) { + return refinementAttributesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(refinementAttributes_); + } + } + /** + * + * + *
+       * A list of ranked refinement attributes.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute.Builder + addRefinementAttributesBuilder() { + return getRefinementAttributesFieldBuilder() + .addBuilder( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute.getDefaultInstance()); + } + /** + * + * + *
+       * A list of ranked refinement attributes.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute.Builder + addRefinementAttributesBuilder(int index) { + return getRefinementAttributesFieldBuilder() + .addBuilder( + index, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute.getDefaultInstance()); + } + /** + * + * + *
+       * A list of ranked refinement attributes.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.RefinementAttribute refinement_attributes = 1; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute.Builder> + getRefinementAttributesBuilderList() { + return getRefinementAttributesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttributeOrBuilder> + getRefinementAttributesFieldBuilder() { + if (refinementAttributesBuilder_ == null) { + refinementAttributesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttribute.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .RefinementAttributeOrBuilder>( + refinementAttributes_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + refinementAttributes_ = null; + } + return refinementAttributesBuilder_; + } + + private com.google.protobuf.LazyStringArrayList followUpQuestions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureFollowUpQuestionsIsMutable() { + if (!followUpQuestions_.isModifiable()) { + followUpQuestions_ = new com.google.protobuf.LazyStringArrayList(followUpQuestions_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+       * Suggested follow-up questions.
+       * 
+ * + * repeated string follow_up_questions = 2; + * + * @return A list containing the followUpQuestions. + */ + public com.google.protobuf.ProtocolStringList getFollowUpQuestionsList() { + followUpQuestions_.makeImmutable(); + return followUpQuestions_; + } + /** + * + * + *
+       * Suggested follow-up questions.
+       * 
+ * + * repeated string follow_up_questions = 2; + * + * @return The count of followUpQuestions. + */ + public int getFollowUpQuestionsCount() { + return followUpQuestions_.size(); + } + /** + * + * + *
+       * Suggested follow-up questions.
+       * 
+ * + * repeated string follow_up_questions = 2; + * + * @param index The index of the element to return. + * @return The followUpQuestions at the given index. + */ + public java.lang.String getFollowUpQuestions(int index) { + return followUpQuestions_.get(index); + } + /** + * + * + *
+       * Suggested follow-up questions.
+       * 
+ * + * repeated string follow_up_questions = 2; + * + * @param index The index of the value to return. + * @return The bytes of the followUpQuestions at the given index. + */ + public com.google.protobuf.ByteString getFollowUpQuestionsBytes(int index) { + return followUpQuestions_.getByteString(index); + } + /** + * + * + *
+       * Suggested follow-up questions.
+       * 
+ * + * repeated string follow_up_questions = 2; + * + * @param index The index to set the value at. + * @param value The followUpQuestions to set. + * @return This builder for chaining. + */ + public Builder setFollowUpQuestions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFollowUpQuestionsIsMutable(); + followUpQuestions_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Suggested follow-up questions.
+       * 
+ * + * repeated string follow_up_questions = 2; + * + * @param value The followUpQuestions to add. + * @return This builder for chaining. + */ + public Builder addFollowUpQuestions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFollowUpQuestionsIsMutable(); + followUpQuestions_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Suggested follow-up questions.
+       * 
+ * + * repeated string follow_up_questions = 2; + * + * @param values The followUpQuestions to add. + * @return This builder for chaining. + */ + public Builder addAllFollowUpQuestions(java.lang.Iterable values) { + ensureFollowUpQuestionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, followUpQuestions_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Suggested follow-up questions.
+       * 
+ * + * repeated string follow_up_questions = 2; + * + * @return This builder for chaining. + */ + public Builder clearFollowUpQuestions() { + followUpQuestions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + /** + * + * + *
+       * Suggested follow-up questions.
+       * 
+ * + * repeated string follow_up_questions = 2; + * + * @param value The bytes of the followUpQuestions to add. + * @return This builder for chaining. + */ + public Builder addFollowUpQuestionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureFollowUpQuestionsIsMutable(); + followUpQuestions_.add(value); + bitField0_ |= 0x00000002; + 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.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult) + private static final com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult(); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GuidedSearchResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SummaryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchResponse.Summary) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The summary content.
+     * 
+ * + * string summary_text = 1; + * + * @return The summaryText. + */ + java.lang.String getSummaryText(); + /** + * + * + *
+     * The summary content.
+     * 
+ * + * string summary_text = 1; + * + * @return The bytes for summaryText. + */ + com.google.protobuf.ByteString getSummaryTextBytes(); + + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return A list containing the summarySkippedReasons. + */ + java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason> + getSummarySkippedReasonsList(); + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return The count of summarySkippedReasons. + */ + int getSummarySkippedReasonsCount(); + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param index The index of the element to return. + * @return The summarySkippedReasons at the given index. + */ + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason + getSummarySkippedReasons(int index); + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return A list containing the enum numeric values on the wire for summarySkippedReasons. + */ + java.util.List getSummarySkippedReasonsValueList(); + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of summarySkippedReasons at the given index. + */ + int getSummarySkippedReasonsValue(int index); + + /** + * + * + *
+     * A collection of Safety Attribute categories and their associated
+     * confidence scores.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + * + * @return Whether the safetyAttributes field is set. + */ + boolean hasSafetyAttributes(); + /** + * + * + *
+     * A collection of Safety Attribute categories and their associated
+     * confidence scores.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + * + * @return The safetyAttributes. + */ + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + getSafetyAttributes(); + /** + * + * + *
+     * A collection of Safety Attribute categories and their associated
+     * confidence scores.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributesOrBuilder + getSafetyAttributesOrBuilder(); + } + /** + * + * + *
+   * Summary of the top N search result specified by the summary spec.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchResponse.Summary} + */ + public static final class Summary extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.SearchResponse.Summary) + SummaryOrBuilder { + private static final long serialVersionUID = 0L; + // Use Summary.newBuilder() to construct. + private Summary(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Summary() { + summaryText_ = ""; + summarySkippedReasons_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Summary(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Summary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Summary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.class, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Builder.class); + } + + /** + * + * + *
+     * An Enum for summary-skipped reasons.
+     * 
+ * + * Protobuf enum {@code + * google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason} + */ + public enum SummarySkippedReason implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Default value. The summary skipped reason is not specified.
+       * 
+ * + * SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0; + */ + SUMMARY_SKIPPED_REASON_UNSPECIFIED(0), + /** + * + * + *
+       * The adversarial query ignored case.
+       *
+       * Only populated when
+       * [SummarySpec.ignore_adversarial_query][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec.ignore_adversarial_query]
+       * is set to `true`.
+       * 
+ * + * ADVERSARIAL_QUERY_IGNORED = 1; + */ + ADVERSARIAL_QUERY_IGNORED(1), + /** + * + * + *
+       * The non-summary seeking query ignored case.
+       *
+       * Only populated when
+       * [SummarySpec.ignore_non_summary_seeking_query][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_summary_seeking_query]
+       * is set to `true`.
+       * 
+ * + * NON_SUMMARY_SEEKING_QUERY_IGNORED = 2; + */ + NON_SUMMARY_SEEKING_QUERY_IGNORED(2), + /** + * + * + *
+       * The out-of-domain query ignored case.
+       *
+       * Google skips the summary if there are no high-relevance search results.
+       * For example, the data store contains facts about company A but the
+       * user query is asking questions about company B.
+       * 
+ * + * OUT_OF_DOMAIN_QUERY_IGNORED = 3; + */ + OUT_OF_DOMAIN_QUERY_IGNORED(3), + /** + * + * + *
+       * The potential policy violation case.
+       *
+       * Google skips the summary if there is a potential policy violation
+       * detected. This includes content that may be violent or toxic.
+       * 
+ * + * POTENTIAL_POLICY_VIOLATION = 4; + */ + POTENTIAL_POLICY_VIOLATION(4), + /** + * + * + *
+       * The LLM addon not enabled case.
+       *
+       * Google skips the summary if the LLM addon is not enabled.
+       * 
+ * + * LLM_ADDON_NOT_ENABLED = 5; + */ + LLM_ADDON_NOT_ENABLED(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Default value. The summary skipped reason is not specified.
+       * 
+ * + * SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0; + */ + public static final int SUMMARY_SKIPPED_REASON_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * The adversarial query ignored case.
+       *
+       * Only populated when
+       * [SummarySpec.ignore_adversarial_query][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec.ignore_adversarial_query]
+       * is set to `true`.
+       * 
+ * + * ADVERSARIAL_QUERY_IGNORED = 1; + */ + public static final int ADVERSARIAL_QUERY_IGNORED_VALUE = 1; + /** + * + * + *
+       * The non-summary seeking query ignored case.
+       *
+       * Only populated when
+       * [SummarySpec.ignore_non_summary_seeking_query][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_summary_seeking_query]
+       * is set to `true`.
+       * 
+ * + * NON_SUMMARY_SEEKING_QUERY_IGNORED = 2; + */ + public static final int NON_SUMMARY_SEEKING_QUERY_IGNORED_VALUE = 2; + /** + * + * + *
+       * The out-of-domain query ignored case.
+       *
+       * Google skips the summary if there are no high-relevance search results.
+       * For example, the data store contains facts about company A but the
+       * user query is asking questions about company B.
+       * 
+ * + * OUT_OF_DOMAIN_QUERY_IGNORED = 3; + */ + public static final int OUT_OF_DOMAIN_QUERY_IGNORED_VALUE = 3; + /** + * + * + *
+       * The potential policy violation case.
+       *
+       * Google skips the summary if there is a potential policy violation
+       * detected. This includes content that may be violent or toxic.
+       * 
+ * + * POTENTIAL_POLICY_VIOLATION = 4; + */ + public static final int POTENTIAL_POLICY_VIOLATION_VALUE = 4; + /** + * + * + *
+       * The LLM addon not enabled case.
+       *
+       * Google skips the summary if the LLM addon is not enabled.
+       * 
+ * + * LLM_ADDON_NOT_ENABLED = 5; + */ + public static final int LLM_ADDON_NOT_ENABLED_VALUE = 5; + + 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 SummarySkippedReason 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 SummarySkippedReason forNumber(int value) { + switch (value) { + case 0: + return SUMMARY_SKIPPED_REASON_UNSPECIFIED; + case 1: + return ADVERSARIAL_QUERY_IGNORED; + case 2: + return NON_SUMMARY_SEEKING_QUERY_IGNORED; + case 3: + return OUT_OF_DOMAIN_QUERY_IGNORED; + case 4: + return POTENTIAL_POLICY_VIOLATION; + case 5: + return LLM_ADDON_NOT_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 SummarySkippedReason findValueByNumber(int number) { + return SummarySkippedReason.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.discoveryengine.v1alpha.SearchResponse.Summary.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final SummarySkippedReason[] VALUES = values(); + + public static SummarySkippedReason 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 SummarySkippedReason(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason) + } + + public interface SafetyAttributesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @return A list containing the categories. + */ + java.util.List getCategoriesList(); + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @return The count of categories. + */ + int getCategoriesCount(); + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @param index The index of the element to return. + * @return The categories at the given index. + */ + java.lang.String getCategories(int index); + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @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); + + /** + * + * + *
+       * The confidence scores of the each category, higher
+       * value means higher confidence. Order matches the Categories.
+       * 
+ * + * repeated float scores = 2; + * + * @return A list containing the scores. + */ + java.util.List getScoresList(); + /** + * + * + *
+       * The confidence scores of the each category, higher
+       * value means higher confidence. Order matches the Categories.
+       * 
+ * + * repeated float scores = 2; + * + * @return The count of scores. + */ + int getScoresCount(); + /** + * + * + *
+       * The confidence scores of the each category, higher
+       * value means higher confidence. Order matches the Categories.
+       * 
+ * + * repeated float scores = 2; + * + * @param index The index of the element to return. + * @return The scores at the given index. + */ + float getScores(int index); + } + /** + * + * + *
+     * Safety Attribute categories and their associated confidence scores.
+     * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes} + */ + public static final class SafetyAttributes extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes) + SafetyAttributesOrBuilder { + private static final long serialVersionUID = 0L; + // Use SafetyAttributes.newBuilder() to construct. + private SafetyAttributes(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SafetyAttributes() { + categories_ = com.google.protobuf.LazyStringArrayList.emptyList(); + scores_ = emptyFloatList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SafetyAttributes(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Summary_SafetyAttributes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Summary_SafetyAttributes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + .class, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + .Builder.class); + } + + public static final int CATEGORIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList categories_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @return A list containing the categories. + */ + public com.google.protobuf.ProtocolStringList getCategoriesList() { + return categories_; + } + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @return The count of categories. + */ + public int getCategoriesCount() { + return categories_.size(); + } + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @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); + } + /** + * + * + *
+       * The display names of Safety Attribute categories associated with the
+       * generated content. Order matches the Scores.
+       * 
+ * + * repeated string categories = 1; + * + * @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 SCORES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.FloatList scores_; + /** + * + * + *
+       * The confidence scores of the each category, higher
+       * value means higher confidence. Order matches the Categories.
+       * 
+ * + * repeated float scores = 2; + * + * @return A list containing the scores. + */ + @java.lang.Override + public java.util.List getScoresList() { + return scores_; + } + /** + * + * + *
+       * The confidence scores of the each category, higher
+       * value means higher confidence. Order matches the Categories.
+       * 
+ * + * repeated float scores = 2; + * + * @return The count of scores. + */ + public int getScoresCount() { + return scores_.size(); + } + /** + * + * + *
+       * The confidence scores of the each category, higher
+       * value means higher confidence. Order matches the Categories.
+       * 
+ * + * repeated float scores = 2; + * + * @param index The index of the element to return. + * @return The scores at the given index. + */ + public float getScores(int index) { + return scores_.getFloat(index); + } + + private int scoresMemoizedSerializedSize = -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(); + for (int i = 0; i < categories_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, categories_.getRaw(i)); + } + if (getScoresList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(scoresMemoizedSerializedSize); + } + for (int i = 0; i < scores_.size(); i++) { + output.writeFloatNoTag(scores_.getFloat(i)); + } + getUnknownFields().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 < categories_.size(); i++) { + dataSize += computeStringSizeNoTag(categories_.getRaw(i)); + } + size += dataSize; + size += 1 * getCategoriesList().size(); + } + { + int dataSize = 0; + dataSize = 4 * getScoresList().size(); + size += dataSize; + if (!getScoresList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + scoresMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes other = + (com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes) obj; + + if (!getCategoriesList().equals(other.getCategoriesList())) return false; + if (!getScoresList().equals(other.getScoresList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getCategoriesCount() > 0) { + hash = (37 * hash) + CATEGORIES_FIELD_NUMBER; + hash = (53 * hash) + getCategoriesList().hashCode(); + } + if (getScoresCount() > 0) { + hash = (37 * hash) + SCORES_FIELD_NUMBER; + hash = (53 * hash) + getScoresList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * Safety Attribute categories and their associated confidence scores.
+       * 
+ * + * Protobuf type {@code + * google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes) + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary + .SafetyAttributesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Summary_SafetyAttributes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Summary_SafetyAttributes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + .class, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + .Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + categories_ = com.google.protobuf.LazyStringArrayList.emptyList(); + scores_ = emptyFloatList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Summary_SafetyAttributes_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + build() { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes result = + new com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes( + this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + result) { + if (((bitField0_ & 0x00000002) != 0)) { + scores_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.scores_ = scores_; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + categories_.makeImmutable(); + result.categories_ = categories_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + .getDefaultInstance()) return this; + if (!other.categories_.isEmpty()) { + if (categories_.isEmpty()) { + categories_ = other.categories_; + bitField0_ |= 0x00000001; + } else { + ensureCategoriesIsMutable(); + categories_.addAll(other.categories_); + } + onChanged(); + } + if (!other.scores_.isEmpty()) { + if (scores_.isEmpty()) { + scores_ = other.scores_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureScoresIsMutable(); + scores_.addAll(other.scores_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureCategoriesIsMutable(); + categories_.add(s); + break; + } // case 10 + case 21: + { + float v = input.readFloat(); + ensureScoresIsMutable(); + scores_.addFloat(v); + break; + } // case 21 + case 18: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureScoresIsMutable(); + while (input.getBytesUntilLimit() > 0) { + scores_.addFloat(input.readFloat()); + } + input.popLimit(limit); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList categories_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureCategoriesIsMutable() { + if (!categories_.isModifiable()) { + categories_ = new com.google.protobuf.LazyStringArrayList(categories_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @return A list containing the categories. + */ + public com.google.protobuf.ProtocolStringList getCategoriesList() { + categories_.makeImmutable(); + return categories_; + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @return The count of categories. + */ + public int getCategoriesCount() { + return categories_.size(); + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @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); + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @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); + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @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); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @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); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @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_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @return This builder for chaining. + */ + public Builder clearCategories() { + categories_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+         * The display names of Safety Attribute categories associated with the
+         * generated content. Order matches the Scores.
+         * 
+ * + * repeated string categories = 1; + * + * @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); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.FloatList scores_ = emptyFloatList(); + + private void ensureScoresIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + scores_ = mutableCopy(scores_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+         * The confidence scores of the each category, higher
+         * value means higher confidence. Order matches the Categories.
+         * 
+ * + * repeated float scores = 2; + * + * @return A list containing the scores. + */ + public java.util.List getScoresList() { + return ((bitField0_ & 0x00000002) != 0) + ? java.util.Collections.unmodifiableList(scores_) + : scores_; + } + /** + * + * + *
+         * The confidence scores of the each category, higher
+         * value means higher confidence. Order matches the Categories.
+         * 
+ * + * repeated float scores = 2; + * + * @return The count of scores. + */ + public int getScoresCount() { + return scores_.size(); + } + /** + * + * + *
+         * The confidence scores of the each category, higher
+         * value means higher confidence. Order matches the Categories.
+         * 
+ * + * repeated float scores = 2; + * + * @param index The index of the element to return. + * @return The scores at the given index. + */ + public float getScores(int index) { + return scores_.getFloat(index); + } + /** + * + * + *
+         * The confidence scores of the each category, higher
+         * value means higher confidence. Order matches the Categories.
+         * 
+ * + * repeated float scores = 2; + * + * @param index The index to set the value at. + * @param value The scores to set. + * @return This builder for chaining. + */ + public Builder setScores(int index, float value) { + + ensureScoresIsMutable(); + scores_.setFloat(index, value); + onChanged(); + return this; + } + /** + * + * + *
+         * The confidence scores of the each category, higher
+         * value means higher confidence. Order matches the Categories.
+         * 
+ * + * repeated float scores = 2; + * + * @param value The scores to add. + * @return This builder for chaining. + */ + public Builder addScores(float value) { + + ensureScoresIsMutable(); + scores_.addFloat(value); + onChanged(); + return this; + } + /** + * + * + *
+         * The confidence scores of the each category, higher
+         * value means higher confidence. Order matches the Categories.
+         * 
+ * + * repeated float scores = 2; + * + * @param values The scores to add. + * @return This builder for chaining. + */ + public Builder addAllScores(java.lang.Iterable values) { + ensureScoresIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, scores_); + onChanged(); + return this; + } + /** + * + * + *
+         * The confidence scores of the each category, higher
+         * value means higher confidence. Order matches the Categories.
+         * 
+ * + * repeated float scores = 2; + * + * @return This builder for chaining. + */ + public Builder clearScores() { + scores_ = emptyFloatList(); + bitField0_ = (bitField0_ & ~0x00000002); + 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.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes) + private static final com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary + .SafetyAttributes + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes(); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SafetyAttributes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int SUMMARY_TEXT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object summaryText_ = ""; + /** + * + * + *
+     * The summary content.
+     * 
+ * + * string summary_text = 1; + * + * @return The summaryText. + */ + @java.lang.Override + public java.lang.String getSummaryText() { + java.lang.Object ref = summaryText_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + summaryText_ = s; + return s; + } + } + /** + * + * + *
+     * The summary content.
+     * 
+ * + * string summary_text = 1; + * + * @return The bytes for summaryText. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSummaryTextBytes() { + java.lang.Object ref = summaryText_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + summaryText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SUMMARY_SKIPPED_REASONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List summarySkippedReasons_; + + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason> + summarySkippedReasons_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary + .SummarySkippedReason>() { + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary + .SummarySkippedReason + convert(java.lang.Integer from) { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason + result = + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary + .SummarySkippedReason.forNumber(from); + return result == null + ? com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary + .SummarySkippedReason.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return A list containing the summarySkippedReasons. + */ + @java.lang.Override + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason> + getSummarySkippedReasonsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason>( + summarySkippedReasons_, summarySkippedReasons_converter_); + } + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return The count of summarySkippedReasons. + */ + @java.lang.Override + public int getSummarySkippedReasonsCount() { + return summarySkippedReasons_.size(); + } + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param index The index of the element to return. + * @return The summarySkippedReasons at the given index. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason + getSummarySkippedReasons(int index) { + return summarySkippedReasons_converter_.convert(summarySkippedReasons_.get(index)); + } + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return A list containing the enum numeric values on the wire for summarySkippedReasons. + */ + @java.lang.Override + public java.util.List getSummarySkippedReasonsValueList() { + return summarySkippedReasons_; + } + /** + * + * + *
+     * Additional summary-skipped reasons. This provides the reason for ignored
+     * cases. If nothing is skipped, this field is not set.
+     * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of summarySkippedReasons at the given index. + */ + @java.lang.Override + public int getSummarySkippedReasonsValue(int index) { + return summarySkippedReasons_.get(index); + } + + private int summarySkippedReasonsMemoizedSerializedSize; + + public static final int SAFETY_ATTRIBUTES_FIELD_NUMBER = 3; + private com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + safetyAttributes_; + /** + * + * + *
+     * A collection of Safety Attribute categories and their associated
+     * confidence scores.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + * + * @return Whether the safetyAttributes field is set. + */ + @java.lang.Override + public boolean hasSafetyAttributes() { + return safetyAttributes_ != null; + } + /** + * + * + *
+     * A collection of Safety Attribute categories and their associated
+     * confidence scores.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + * + * @return The safetyAttributes. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + getSafetyAttributes() { + return safetyAttributes_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + .getDefaultInstance() + : safetyAttributes_; + } + /** + * + * + *
+     * A collection of Safety Attribute categories and their associated
+     * confidence scores.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributesOrBuilder + getSafetyAttributesOrBuilder() { + return safetyAttributes_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + .getDefaultInstance() + : safetyAttributes_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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(summaryText_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, summaryText_); + } + if (getSummarySkippedReasonsList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(summarySkippedReasonsMemoizedSerializedSize); + } + for (int i = 0; i < summarySkippedReasons_.size(); i++) { + output.writeEnumNoTag(summarySkippedReasons_.get(i)); + } + if (safetyAttributes_ != null) { + output.writeMessage(3, getSafetyAttributes()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(summaryText_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, summaryText_); + } + { + int dataSize = 0; + for (int i = 0; i < summarySkippedReasons_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag( + summarySkippedReasons_.get(i)); + } + size += dataSize; + if (!getSummarySkippedReasonsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + summarySkippedReasonsMemoizedSerializedSize = dataSize; + } + if (safetyAttributes_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSafetyAttributes()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary other = + (com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary) obj; + + if (!getSummaryText().equals(other.getSummaryText())) return false; + if (!summarySkippedReasons_.equals(other.summarySkippedReasons_)) return false; + if (hasSafetyAttributes() != other.hasSafetyAttributes()) return false; + if (hasSafetyAttributes()) { + if (!getSafetyAttributes().equals(other.getSafetyAttributes())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SUMMARY_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getSummaryText().hashCode(); + if (getSummarySkippedReasonsCount() > 0) { + hash = (37 * hash) + SUMMARY_SKIPPED_REASONS_FIELD_NUMBER; + hash = (53 * hash) + summarySkippedReasons_.hashCode(); + } + if (hasSafetyAttributes()) { + hash = (37 * hash) + SAFETY_ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + getSafetyAttributes().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Summary of the top N search result specified by the summary spec.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchResponse.Summary} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchResponse.Summary) + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SummaryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Summary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Summary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.class, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + summaryText_ = ""; + summarySkippedReasons_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + safetyAttributes_ = null; + if (safetyAttributesBuilder_ != null) { + safetyAttributesBuilder_.dispose(); + safetyAttributesBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Summary_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary build() { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary result = + new com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary result) { + if (((bitField0_ & 0x00000002) != 0)) { + summarySkippedReasons_ = java.util.Collections.unmodifiableList(summarySkippedReasons_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.summarySkippedReasons_ = summarySkippedReasons_; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.summaryText_ = summaryText_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.safetyAttributes_ = + safetyAttributesBuilder_ == null + ? safetyAttributes_ + : safetyAttributesBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.getDefaultInstance()) + return this; + if (!other.getSummaryText().isEmpty()) { + summaryText_ = other.summaryText_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.summarySkippedReasons_.isEmpty()) { + if (summarySkippedReasons_.isEmpty()) { + summarySkippedReasons_ = other.summarySkippedReasons_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSummarySkippedReasonsIsMutable(); + summarySkippedReasons_.addAll(other.summarySkippedReasons_); + } + onChanged(); + } + if (other.hasSafetyAttributes()) { + mergeSafetyAttributes(other.getSafetyAttributes()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + summaryText_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + int tmpRaw = input.readEnum(); + ensureSummarySkippedReasonsIsMutable(); + summarySkippedReasons_.add(tmpRaw); + break; + } // case 16 + case 18: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureSummarySkippedReasonsIsMutable(); + summarySkippedReasons_.add(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 18 + case 26: + { + input.readMessage( + getSafetyAttributesFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object summaryText_ = ""; + /** + * + * + *
+       * The summary content.
+       * 
+ * + * string summary_text = 1; + * + * @return The summaryText. + */ + public java.lang.String getSummaryText() { + java.lang.Object ref = summaryText_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + summaryText_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The summary content.
+       * 
+ * + * string summary_text = 1; + * + * @return The bytes for summaryText. + */ + public com.google.protobuf.ByteString getSummaryTextBytes() { + java.lang.Object ref = summaryText_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + summaryText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The summary content.
+       * 
+ * + * string summary_text = 1; + * + * @param value The summaryText to set. + * @return This builder for chaining. + */ + public Builder setSummaryText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + summaryText_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The summary content.
+       * 
+ * + * string summary_text = 1; + * + * @return This builder for chaining. + */ + public Builder clearSummaryText() { + summaryText_ = getDefaultInstance().getSummaryText(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The summary content.
+       * 
+ * + * string summary_text = 1; + * + * @param value The bytes for summaryText to set. + * @return This builder for chaining. + */ + public Builder setSummaryTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + summaryText_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List summarySkippedReasons_ = + java.util.Collections.emptyList(); + + private void ensureSummarySkippedReasonsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + summarySkippedReasons_ = + new java.util.ArrayList(summarySkippedReasons_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return A list containing the summarySkippedReasons. + */ + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason> + getSummarySkippedReasonsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason>( + summarySkippedReasons_, summarySkippedReasons_converter_); + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return The count of summarySkippedReasons. + */ + public int getSummarySkippedReasonsCount() { + return summarySkippedReasons_.size(); + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param index The index of the element to return. + * @return The summarySkippedReasons at the given index. + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason + getSummarySkippedReasons(int index) { + return summarySkippedReasons_converter_.convert(summarySkippedReasons_.get(index)); + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param index The index to set the value at. + * @param value The summarySkippedReasons to set. + * @return This builder for chaining. + */ + public Builder setSummarySkippedReasons( + int index, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason + value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSummarySkippedReasonsIsMutable(); + summarySkippedReasons_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param value The summarySkippedReasons to add. + * @return This builder for chaining. + */ + public Builder addSummarySkippedReasons( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason + value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSummarySkippedReasonsIsMutable(); + summarySkippedReasons_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param values The summarySkippedReasons to add. + * @return This builder for chaining. + */ + public Builder addAllSummarySkippedReasons( + java.lang.Iterable< + ? extends + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary + .SummarySkippedReason> + values) { + ensureSummarySkippedReasonsIsMutable(); + for (com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason + value : values) { + summarySkippedReasons_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearSummarySkippedReasons() { + summarySkippedReasons_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @return A list containing the enum numeric values on the wire for summarySkippedReasons. + */ + public java.util.List getSummarySkippedReasonsValueList() { + return java.util.Collections.unmodifiableList(summarySkippedReasons_); + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of summarySkippedReasons at the given index. + */ + public int getSummarySkippedReasonsValue(int index) { + return summarySkippedReasons_.get(index); + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for summarySkippedReasons to set. + * @return This builder for chaining. + */ + public Builder setSummarySkippedReasonsValue(int index, int value) { + ensureSummarySkippedReasonsIsMutable(); + summarySkippedReasons_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param value The enum numeric value on the wire for summarySkippedReasons to add. + * @return This builder for chaining. + */ + public Builder addSummarySkippedReasonsValue(int value) { + ensureSummarySkippedReasonsIsMutable(); + summarySkippedReasons_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Additional summary-skipped reasons. This provides the reason for ignored
+       * cases. If nothing is skipped, this field is not set.
+       * 
+ * + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SummarySkippedReason summary_skipped_reasons = 2; + * + * + * @param values The enum numeric values on the wire for summarySkippedReasons to add. + * @return This builder for chaining. + */ + public Builder addAllSummarySkippedReasonsValue( + java.lang.Iterable values) { + ensureSummarySkippedReasonsIsMutable(); + for (int value : values) { + summarySkippedReasons_.add(value); + } + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + safetyAttributes_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + .Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary + .SafetyAttributesOrBuilder> + safetyAttributesBuilder_; + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + * + * @return Whether the safetyAttributes field is set. + */ + public boolean hasSafetyAttributes() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + * + * @return The safetyAttributes. + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + getSafetyAttributes() { + if (safetyAttributesBuilder_ == null) { + return safetyAttributes_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + .getDefaultInstance() + : safetyAttributes_; + } else { + return safetyAttributesBuilder_.getMessage(); + } + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + public Builder setSafetyAttributes( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes value) { + if (safetyAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + safetyAttributes_ = value; + } else { + safetyAttributesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + public Builder setSafetyAttributes( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes.Builder + builderForValue) { + if (safetyAttributesBuilder_ == null) { + safetyAttributes_ = builderForValue.build(); + } else { + safetyAttributesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + public Builder mergeSafetyAttributes( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes value) { + if (safetyAttributesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && safetyAttributes_ != null + && safetyAttributes_ + != com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary + .SafetyAttributes.getDefaultInstance()) { + getSafetyAttributesBuilder().mergeFrom(value); + } else { + safetyAttributes_ = value; + } + } else { + safetyAttributesBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + public Builder clearSafetyAttributes() { + bitField0_ = (bitField0_ & ~0x00000004); + safetyAttributes_ = null; + if (safetyAttributesBuilder_ != null) { + safetyAttributesBuilder_.dispose(); + safetyAttributesBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + .Builder + getSafetyAttributesBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getSafetyAttributesFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary + .SafetyAttributesOrBuilder + getSafetyAttributesOrBuilder() { + if (safetyAttributesBuilder_ != null) { + return safetyAttributesBuilder_.getMessageOrBuilder(); + } else { + return safetyAttributes_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + .getDefaultInstance() + : safetyAttributes_; + } + } + /** + * + * + *
+       * A collection of Safety Attribute categories and their associated
+       * confidence scores.
+       * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes safety_attributes = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + .Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary + .SafetyAttributesOrBuilder> + getSafetyAttributesFieldBuilder() { + if (safetyAttributesBuilder_ == null) { + safetyAttributesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.SafetyAttributes + .Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary + .SafetyAttributesOrBuilder>( + getSafetyAttributes(), getParentForChildren(), isClean()); + safetyAttributes_ = null; + } + return safetyAttributesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.SearchResponse.Summary) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchResponse.Summary) + private static final com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary(); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Summary parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface GeoSearchDebugInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The address from which forward geocoding ingestion produced issues.
+     * 
+ * + * string original_address_query = 1; + * + * @return The originalAddressQuery. + */ + java.lang.String getOriginalAddressQuery(); + /** + * + * + *
+     * The address from which forward geocoding ingestion produced issues.
+     * 
+ * + * string original_address_query = 1; + * + * @return The bytes for originalAddressQuery. + */ + com.google.protobuf.ByteString getOriginalAddressQueryBytes(); + + /** + * + * + *
+     * The error produced.
+     * 
+ * + * string error_message = 2; + * + * @return The errorMessage. + */ + java.lang.String getErrorMessage(); + /** + * + * + *
+     * The error produced.
+     * 
+ * + * string error_message = 2; + * + * @return The bytes for errorMessage. + */ + com.google.protobuf.ByteString getErrorMessageBytes(); + } + /** + * + * + *
+   * Debug information specifically related to forward geocoding issues arising
+   * from Geolocation Search.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo} + */ + public static final class GeoSearchDebugInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo) + GeoSearchDebugInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use GeoSearchDebugInfo.newBuilder() to construct. + private GeoSearchDebugInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GeoSearchDebugInfo() { + originalAddressQuery_ = ""; + errorMessage_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GeoSearchDebugInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GeoSearchDebugInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GeoSearchDebugInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo.class, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo.Builder + .class); + } + + public static final int ORIGINAL_ADDRESS_QUERY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object originalAddressQuery_ = ""; + /** + * + * + *
+     * The address from which forward geocoding ingestion produced issues.
+     * 
+ * + * string original_address_query = 1; + * + * @return The originalAddressQuery. + */ + @java.lang.Override + public java.lang.String getOriginalAddressQuery() { + java.lang.Object ref = originalAddressQuery_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + originalAddressQuery_ = s; + return s; + } + } + /** + * + * + *
+     * The address from which forward geocoding ingestion produced issues.
+     * 
+ * + * string original_address_query = 1; + * + * @return The bytes for originalAddressQuery. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOriginalAddressQueryBytes() { + java.lang.Object ref = originalAddressQuery_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + originalAddressQuery_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERROR_MESSAGE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object errorMessage_ = ""; + /** + * + * + *
+     * The error produced.
+     * 
+ * + * string error_message = 2; + * + * @return The errorMessage. + */ + @java.lang.Override + public java.lang.String getErrorMessage() { + java.lang.Object ref = errorMessage_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errorMessage_ = s; + return s; + } + } + /** + * + * + *
+     * The error produced.
+     * 
+ * + * string error_message = 2; + * + * @return The bytes for errorMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getErrorMessageBytes() { + java.lang.Object ref = errorMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMessage_ = 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(originalAddressQuery_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, originalAddressQuery_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, errorMessage_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(originalAddressQuery_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, originalAddressQuery_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, errorMessage_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo other = + (com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo) obj; + + if (!getOriginalAddressQuery().equals(other.getOriginalAddressQuery())) return false; + if (!getErrorMessage().equals(other.getErrorMessage())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ORIGINAL_ADDRESS_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getOriginalAddressQuery().hashCode(); + hash = (37 * hash) + ERROR_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getErrorMessage().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Debug information specifically related to forward geocoding issues arising
+     * from Geolocation Search.
+     * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo) + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GeoSearchDebugInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GeoSearchDebugInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo.class, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo.Builder + .class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + originalAddressQuery_ = ""; + errorMessage_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GeoSearchDebugInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo build() { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo result = + new com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.originalAddressQuery_ = originalAddressQuery_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.errorMessage_ = errorMessage_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + .getDefaultInstance()) return this; + if (!other.getOriginalAddressQuery().isEmpty()) { + originalAddressQuery_ = other.originalAddressQuery_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getErrorMessage().isEmpty()) { + errorMessage_ = other.errorMessage_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + originalAddressQuery_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + errorMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object originalAddressQuery_ = ""; + /** + * + * + *
+       * The address from which forward geocoding ingestion produced issues.
+       * 
+ * + * string original_address_query = 1; + * + * @return The originalAddressQuery. + */ + public java.lang.String getOriginalAddressQuery() { + java.lang.Object ref = originalAddressQuery_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + originalAddressQuery_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The address from which forward geocoding ingestion produced issues.
+       * 
+ * + * string original_address_query = 1; + * + * @return The bytes for originalAddressQuery. + */ + public com.google.protobuf.ByteString getOriginalAddressQueryBytes() { + java.lang.Object ref = originalAddressQuery_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + originalAddressQuery_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The address from which forward geocoding ingestion produced issues.
+       * 
+ * + * string original_address_query = 1; + * + * @param value The originalAddressQuery to set. + * @return This builder for chaining. + */ + public Builder setOriginalAddressQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + originalAddressQuery_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The address from which forward geocoding ingestion produced issues.
+       * 
+ * + * string original_address_query = 1; + * + * @return This builder for chaining. + */ + public Builder clearOriginalAddressQuery() { + originalAddressQuery_ = getDefaultInstance().getOriginalAddressQuery(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The address from which forward geocoding ingestion produced issues.
+       * 
+ * + * string original_address_query = 1; + * + * @param value The bytes for originalAddressQuery to set. + * @return This builder for chaining. + */ + public Builder setOriginalAddressQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + originalAddressQuery_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object errorMessage_ = ""; + /** + * + * + *
+       * The error produced.
+       * 
+ * + * string error_message = 2; + * + * @return The errorMessage. + */ + public java.lang.String getErrorMessage() { + java.lang.Object ref = errorMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errorMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The error produced.
+       * 
+ * + * string error_message = 2; + * + * @return The bytes for errorMessage. + */ + public com.google.protobuf.ByteString getErrorMessageBytes() { + java.lang.Object ref = errorMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The error produced.
+       * 
+ * + * string error_message = 2; + * + * @param value The errorMessage to set. + * @return This builder for chaining. + */ + public Builder setErrorMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + errorMessage_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The error produced.
+       * 
+ * + * string error_message = 2; + * + * @return This builder for chaining. + */ + public Builder clearErrorMessage() { + errorMessage_ = getDefaultInstance().getErrorMessage(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * The error produced.
+       * 
+ * + * string error_message = 2; + * + * @param value The bytes for errorMessage to set. + * @return This builder for chaining. + */ + public Builder setErrorMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + errorMessage_ = value; + bitField0_ |= 0x00000002; + 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.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo) + private static final com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo(); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GeoSearchDebugInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface QueryExpansionInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo} + */ + public static final class QueryExpansionInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_QueryExpansionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_QueryExpansionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo.class, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo.Builder + .class); + } + + public static final int EXPANDED_QUERY_FIELD_NUMBER = 1; + private boolean expandedQuery_ = false; + /** + * + * + *
+     * 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_ = 0L; + /** + * + * + *
+     * Number of pinned results. This field will only be set when expansion
+     * happens and
+     * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.discoveryengine.v1alpha.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_); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo other = + (com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo) obj; + + if (getExpandedQuery() != other.getExpandedQuery()) return false; + if (getPinnedResultCount() != other.getPinnedResultCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo) + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_QueryExpansionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_QueryExpansionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo.class, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo.Builder + .class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + expandedQuery_ = false; + pinnedResultCount_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_QueryExpansionInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo build() { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo + buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo result = + new com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.expandedQuery_ = expandedQuery_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pinnedResultCount_ = pinnedResultCount_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo + .getDefaultInstance()) return this; + if (other.getExpandedQuery() != false) { + setExpandedQuery(other.getExpandedQuery()); + } + if (other.getPinnedResultCount() != 0L) { + setPinnedResultCount(other.getPinnedResultCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + expandedQuery_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + pinnedResultCount_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Bool describing whether query expansion has occurred.
+       * 
+ * + * bool expanded_query = 1; + * + * @return This builder for chaining. + */ + public Builder clearExpandedQuery() { + bitField0_ = (bitField0_ & ~0x00000001); + 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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Number of pinned results. This field will only be set when expansion
+       * happens and
+       * [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
+       * is set to true.
+       * 
+ * + * int64 pinned_result_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearPinnedResultCount() { + bitField0_ = (bitField0_ & ~0x00000002); + 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.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo) + private static final com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int RESULTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + results_; + /** + * + * + *
+   * A list of matched documents. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + @java.lang.Override + public java.util.List + getResultsList() { + return results_; + } + /** + * + * + *
+   * A list of matched documents. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResultOrBuilder> + getResultsOrBuilderList() { + return results_; + } + /** + * + * + *
+   * A list of matched documents. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + @java.lang.Override + public int getResultsCount() { + return results_.size(); + } + /** + * + * + *
+   * A list of matched documents. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult getResults( + int index) { + return results_.get(index); + } + /** + * + * + *
+   * A list of matched documents. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResultOrBuilder + getResultsOrBuilder(int index) { + return results_.get(index); + } + + public static final int FACETS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List facets_; + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + @java.lang.Override + public java.util.List + getFacetsList() { + return facets_; + } + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.discoveryengine.v1alpha.SearchResponse.FacetOrBuilder> + getFacetsOrBuilderList() { + return facets_; + } + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + @java.lang.Override + public int getFacetsCount() { + return facets_.size(); + } + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet getFacets(int index) { + return facets_.get(index); + } + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.FacetOrBuilder getFacetsOrBuilder( + int index) { + return facets_.get(index); + } + + public static final int GUIDED_SEARCH_RESULT_FIELD_NUMBER = 8; + private com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + guidedSearchResult_; + /** + * + * + *
+   * Guided search result.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult guided_search_result = 8; + * + * + * @return Whether the guidedSearchResult field is set. + */ + @java.lang.Override + public boolean hasGuidedSearchResult() { + return guidedSearchResult_ != null; + } + /** + * + * + *
+   * Guided search result.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult guided_search_result = 8; + * + * + * @return The guidedSearchResult. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + getGuidedSearchResult() { + return guidedSearchResult_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .getDefaultInstance() + : guidedSearchResult_; + } + /** + * + * + *
+   * Guided search result.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult guided_search_result = 8; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResultOrBuilder + getGuidedSearchResultOrBuilder() { + return guidedSearchResult_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .getDefaultInstance() + : guidedSearchResult_; + } + + public static final int TOTAL_SIZE_FIELD_NUMBER = 3; + private int totalSize_ = 0; + /** + * + * + *
+   * The estimated total count of matched items irrespective of pagination. The
+   * count of
+   * [results][google.cloud.discoveryengine.v1alpha.SearchResponse.results]
+   * returned by pagination may be less than the
+   * [total_size][google.cloud.discoveryengine.v1alpha.SearchResponse.total_size]
+   * that matches.
+   * 
+ * + * int32 total_size = 3; + * + * @return The totalSize. + */ + @java.lang.Override + public int getTotalSize() { + return totalSize_; + } + + public static final int ATTRIBUTION_TOKEN_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object attributionToken_ = ""; + /** + * + * + *
+   * A unique search token. This should be included in the
+   * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] logs resulting
+   * from this search, which enables accurate attribution of search model
+   * performance.
+   * 
+ * + * string attribution_token = 4; + * + * @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.discoveryengine.v1alpha.UserEvent] logs resulting
+   * from this search, which enables accurate attribution of search model
+   * performance.
+   * 
+ * + * string attribution_token = 4; + * + * @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 REDIRECT_URI_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object redirectUri_ = ""; + /** + * + * + *
+   * The URI of a customer-defined redirect page. If redirect action is
+   * triggered, no search is performed, and only
+   * [redirect_uri][google.cloud.discoveryengine.v1alpha.SearchResponse.redirect_uri]
+   * and
+   * [attribution_token][google.cloud.discoveryengine.v1alpha.SearchResponse.attribution_token]
+   * are set in the response.
+   * 
+ * + * string redirect_uri = 12; + * + * @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 is performed, and only
+   * [redirect_uri][google.cloud.discoveryengine.v1alpha.SearchResponse.redirect_uri]
+   * and
+   * [attribution_token][google.cloud.discoveryengine.v1alpha.SearchResponse.attribution_token]
+   * are set in the response.
+   * 
+ * + * string redirect_uri = 12; + * + * @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 NEXT_PAGE_TOKEN_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token that can be sent as
+   * [SearchRequest.page_token][google.cloud.discoveryengine.v1alpha.SearchRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 5; + * + * @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.discoveryengine.v1alpha.SearchRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 5; + * + * @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 CORRECTED_QUERY_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object correctedQuery_ = ""; + /** + * + * + *
+   * Contains the spell corrected query, if found. If the spell correction type
+   * is AUTOMATIC, then the search results are based on corrected_query.
+   * Otherwise the original query is used for search.
+   * 
+ * + * string corrected_query = 7; + * + * @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; + } + } + /** + * + * + *
+   * Contains the spell corrected query, if found. If the spell correction type
+   * is AUTOMATIC, then the search results are based on corrected_query.
+   * Otherwise the original query is used for search.
+   * 
+ * + * string corrected_query = 7; + * + * @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 SUMMARY_FIELD_NUMBER = 9; + private com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary_; + /** + * + * + *
+   * A summary as part of the search results.
+   * This field is only returned if
+   * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.summary_spec]
+   * is set.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 9; + * + * @return Whether the summary field is set. + */ + @java.lang.Override + public boolean hasSummary() { + return summary_ != null; + } + /** + * + * + *
+   * A summary as part of the search results.
+   * This field is only returned if
+   * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.summary_spec]
+   * is set.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 9; + * + * @return The summary. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary getSummary() { + return summary_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.getDefaultInstance() + : summary_; + } + /** + * + * + *
+   * A summary as part of the search results.
+   * This field is only returned if
+   * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.summary_spec]
+   * is set.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 9; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.SummaryOrBuilder + getSummaryOrBuilder() { + return summary_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.getDefaultInstance() + : summary_; + } + + public static final int APPLIED_CONTROLS_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList appliedControls_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Controls applied as part of the Control service.
+   * 
+ * + * repeated string applied_controls = 10; + * + * @return A list containing the appliedControls. + */ + public com.google.protobuf.ProtocolStringList getAppliedControlsList() { + return appliedControls_; + } + /** + * + * + *
+   * Controls applied as part of the Control service.
+   * 
+ * + * repeated string applied_controls = 10; + * + * @return The count of appliedControls. + */ + public int getAppliedControlsCount() { + return appliedControls_.size(); + } + /** + * + * + *
+   * Controls applied as part of the Control service.
+   * 
+ * + * repeated string applied_controls = 10; + * + * @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); + } + /** + * + * + *
+   * Controls applied as part of the Control service.
+   * 
+ * + * repeated string applied_controls = 10; + * + * @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 GEO_SEARCH_DEBUG_INFO_FIELD_NUMBER = 16; + + @SuppressWarnings("serial") + private java.util.List + geoSearchDebugInfo_; + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + @java.lang.Override + public java.util.List + getGeoSearchDebugInfoList() { + return geoSearchDebugInfo_; + } + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfoOrBuilder> + getGeoSearchDebugInfoOrBuilderList() { + return geoSearchDebugInfo_; + } + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + @java.lang.Override + public int getGeoSearchDebugInfoCount() { + return geoSearchDebugInfo_.size(); + } + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + getGeoSearchDebugInfo(int index) { + return geoSearchDebugInfo_.get(index); + } + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfoOrBuilder + getGeoSearchDebugInfoOrBuilder(int index) { + return geoSearchDebugInfo_.get(index); + } + + public static final int QUERY_EXPANSION_INFO_FIELD_NUMBER = 14; + private com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo + queryExpansionInfo_; + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + * + * @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.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + * + * @return The queryExpansionInfo. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo + getQueryExpansionInfo() { + return queryExpansionInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo + .getDefaultInstance() + : queryExpansionInfo_; + } + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfoOrBuilder + getQueryExpansionInfoOrBuilder() { + return queryExpansionInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo + .getDefaultInstance() + : queryExpansionInfo_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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(attributionToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, attributionToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, nextPageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(correctedQuery_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, correctedQuery_); + } + if (guidedSearchResult_ != null) { + output.writeMessage(8, getGuidedSearchResult()); + } + if (summary_ != null) { + output.writeMessage(9, getSummary()); + } + for (int i = 0; i < appliedControls_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, appliedControls_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(redirectUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, redirectUri_); + } + if (queryExpansionInfo_ != null) { + output.writeMessage(14, getQueryExpansionInfo()); + } + for (int i = 0; i < geoSearchDebugInfo_.size(); i++) { + output.writeMessage(16, geoSearchDebugInfo_.get(i)); + } + getUnknownFields().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(attributionToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, attributionToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, nextPageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(correctedQuery_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, correctedQuery_); + } + if (guidedSearchResult_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getGuidedSearchResult()); + } + if (summary_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getSummary()); + } + { + int dataSize = 0; + for (int i = 0; i < appliedControls_.size(); i++) { + dataSize += computeStringSizeNoTag(appliedControls_.getRaw(i)); + } + size += dataSize; + size += 1 * getAppliedControlsList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(redirectUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, redirectUri_); + } + if (queryExpansionInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getQueryExpansionInfo()); + } + for (int i = 0; i < geoSearchDebugInfo_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(16, geoSearchDebugInfo_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.SearchResponse)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.SearchResponse other = + (com.google.cloud.discoveryengine.v1alpha.SearchResponse) obj; + + if (!getResultsList().equals(other.getResultsList())) return false; + if (!getFacetsList().equals(other.getFacetsList())) return false; + if (hasGuidedSearchResult() != other.hasGuidedSearchResult()) return false; + if (hasGuidedSearchResult()) { + if (!getGuidedSearchResult().equals(other.getGuidedSearchResult())) return false; + } + if (getTotalSize() != other.getTotalSize()) return false; + if (!getAttributionToken().equals(other.getAttributionToken())) return false; + if (!getRedirectUri().equals(other.getRedirectUri())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getCorrectedQuery().equals(other.getCorrectedQuery())) return false; + if (hasSummary() != other.hasSummary()) return false; + if (hasSummary()) { + if (!getSummary().equals(other.getSummary())) return false; + } + if (!getAppliedControlsList().equals(other.getAppliedControlsList())) return false; + if (!getGeoSearchDebugInfoList().equals(other.getGeoSearchDebugInfoList())) return false; + if (hasQueryExpansionInfo() != other.hasQueryExpansionInfo()) return false; + if (hasQueryExpansionInfo()) { + if (!getQueryExpansionInfo().equals(other.getQueryExpansionInfo())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (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(); + } + if (hasGuidedSearchResult()) { + hash = (37 * hash) + GUIDED_SEARCH_RESULT_FIELD_NUMBER; + hash = (53 * hash) + getGuidedSearchResult().hashCode(); + } + hash = (37 * hash) + TOTAL_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getTotalSize(); + hash = (37 * hash) + ATTRIBUTION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getAttributionToken().hashCode(); + hash = (37 * hash) + REDIRECT_URI_FIELD_NUMBER; + hash = (53 * hash) + getRedirectUri().hashCode(); + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (37 * hash) + CORRECTED_QUERY_FIELD_NUMBER; + hash = (53 * hash) + getCorrectedQuery().hashCode(); + if (hasSummary()) { + hash = (37 * hash) + SUMMARY_FIELD_NUMBER; + hash = (53 * hash) + getSummary().hashCode(); + } + if (getAppliedControlsCount() > 0) { + hash = (37 * hash) + APPLIED_CONTROLS_FIELD_NUMBER; + hash = (53 * hash) + getAppliedControlsList().hashCode(); + } + if (getGeoSearchDebugInfoCount() > 0) { + hash = (37 * hash) + GEO_SEARCH_DEBUG_INFO_FIELD_NUMBER; + hash = (53 * hash) + getGeoSearchDebugInfoList().hashCode(); + } + if (hasQueryExpansionInfo()) { + hash = (37 * hash) + QUERY_EXPANSION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getQueryExpansionInfo().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.SearchResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchService.Search]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.SearchResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.SearchResponse) + com.google.cloud.discoveryengine.v1alpha.SearchResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.class, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.SearchResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + } else { + results_ = null; + resultsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (facetsBuilder_ == null) { + facets_ = java.util.Collections.emptyList(); + } else { + facets_ = null; + facetsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + guidedSearchResult_ = null; + if (guidedSearchResultBuilder_ != null) { + guidedSearchResultBuilder_.dispose(); + guidedSearchResultBuilder_ = null; + } + totalSize_ = 0; + attributionToken_ = ""; + redirectUri_ = ""; + nextPageToken_ = ""; + correctedQuery_ = ""; + summary_ = null; + if (summaryBuilder_ != null) { + summaryBuilder_.dispose(); + summaryBuilder_ = null; + } + appliedControls_ = com.google.protobuf.LazyStringArrayList.emptyList(); + if (geoSearchDebugInfoBuilder_ == null) { + geoSearchDebugInfo_ = java.util.Collections.emptyList(); + } else { + geoSearchDebugInfo_ = null; + geoSearchDebugInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + queryExpansionInfo_ = null; + if (queryExpansionInfoBuilder_ != null) { + queryExpansionInfoBuilder_.dispose(); + queryExpansionInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.SearchResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse build() { + com.google.cloud.discoveryengine.v1alpha.SearchResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse buildPartial() { + com.google.cloud.discoveryengine.v1alpha.SearchResponse result = + new com.google.cloud.discoveryengine.v1alpha.SearchResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.SearchResponse result) { + 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(); + } + if (geoSearchDebugInfoBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0)) { + geoSearchDebugInfo_ = java.util.Collections.unmodifiableList(geoSearchDebugInfo_); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.geoSearchDebugInfo_ = geoSearchDebugInfo_; + } else { + result.geoSearchDebugInfo_ = geoSearchDebugInfoBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.SearchResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.guidedSearchResult_ = + guidedSearchResultBuilder_ == null + ? guidedSearchResult_ + : guidedSearchResultBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.totalSize_ = totalSize_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.attributionToken_ = attributionToken_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.redirectUri_ = redirectUri_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.correctedQuery_ = correctedQuery_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.summary_ = summaryBuilder_ == null ? summary_ : summaryBuilder_.build(); + } + if (((from_bitField0_ & 0x00000200) != 0)) { + appliedControls_.makeImmutable(); + result.appliedControls_ = appliedControls_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.queryExpansionInfo_ = + queryExpansionInfoBuilder_ == null + ? queryExpansionInfo_ + : queryExpansionInfoBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.SearchResponse) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.SearchResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.SearchResponse other) { + if (other == com.google.cloud.discoveryengine.v1alpha.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.hasGuidedSearchResult()) { + mergeGuidedSearchResult(other.getGuidedSearchResult()); + } + if (other.getTotalSize() != 0) { + setTotalSize(other.getTotalSize()); + } + if (!other.getAttributionToken().isEmpty()) { + attributionToken_ = other.attributionToken_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getRedirectUri().isEmpty()) { + redirectUri_ = other.redirectUri_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.getCorrectedQuery().isEmpty()) { + correctedQuery_ = other.correctedQuery_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.hasSummary()) { + mergeSummary(other.getSummary()); + } + if (!other.appliedControls_.isEmpty()) { + if (appliedControls_.isEmpty()) { + appliedControls_ = other.appliedControls_; + bitField0_ |= 0x00000200; + } else { + ensureAppliedControlsIsMutable(); + appliedControls_.addAll(other.appliedControls_); + } + onChanged(); + } + if (geoSearchDebugInfoBuilder_ == null) { + if (!other.geoSearchDebugInfo_.isEmpty()) { + if (geoSearchDebugInfo_.isEmpty()) { + geoSearchDebugInfo_ = other.geoSearchDebugInfo_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureGeoSearchDebugInfoIsMutable(); + geoSearchDebugInfo_.addAll(other.geoSearchDebugInfo_); + } + onChanged(); + } + } else { + if (!other.geoSearchDebugInfo_.isEmpty()) { + if (geoSearchDebugInfoBuilder_.isEmpty()) { + geoSearchDebugInfoBuilder_.dispose(); + geoSearchDebugInfoBuilder_ = null; + geoSearchDebugInfo_ = other.geoSearchDebugInfo_; + bitField0_ = (bitField0_ & ~0x00000400); + geoSearchDebugInfoBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getGeoSearchDebugInfoFieldBuilder() + : null; + } else { + geoSearchDebugInfoBuilder_.addAllMessages(other.geoSearchDebugInfo_); + } + } + } + if (other.hasQueryExpansionInfo()) { + mergeQueryExpansionInfo(other.getQueryExpansionInfo()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult + .parser(), + extensionRegistry); + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(m); + } else { + resultsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.parser(), + extensionRegistry); + if (facetsBuilder_ == null) { + ensureFacetsIsMutable(); + facets_.add(m); + } else { + facetsBuilder_.addMessage(m); + } + break; + } // case 18 + case 24: + { + totalSize_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 24 + case 34: + { + attributionToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 42: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 42 + case 58: + { + correctedQuery_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 58 + case 66: + { + input.readMessage( + getGuidedSearchResultFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 66 + case 74: + { + input.readMessage(getSummaryFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureAppliedControlsIsMutable(); + appliedControls_.add(s); + break; + } // case 82 + case 98: + { + redirectUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 98 + case 114: + { + input.readMessage( + getQueryExpansionInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 114 + case 130: + { + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + .parser(), + extensionRegistry); + if (geoSearchDebugInfoBuilder_ == null) { + ensureGeoSearchDebugInfoIsMutable(); + geoSearchDebugInfo_.add(m); + } else { + geoSearchDebugInfoBuilder_.addMessage(m); + } + break; + } // case 130 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + results_ = java.util.Collections.emptyList(); + + private void ensureResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + results_ = + new java.util.ArrayList< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult>(results_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResultOrBuilder> + resultsBuilder_; + + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.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 documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + public int getResultsCount() { + if (resultsBuilder_ == null) { + return results_.size(); + } else { + return resultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult getResults( + int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + public Builder setResults( + int index, com.google.cloud.discoveryengine.v1alpha.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 documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + public Builder setResults( + int index, + com.google.cloud.discoveryengine.v1alpha.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 documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + public Builder addResults( + com.google.cloud.discoveryengine.v1alpha.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 documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + public Builder addResults( + int index, com.google.cloud.discoveryengine.v1alpha.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 documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + public Builder addResults( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.Builder + builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + public Builder addResults( + int index, + com.google.cloud.discoveryengine.v1alpha.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 documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + public Builder addAllResults( + java.lang.Iterable< + ? extends com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult> + values) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); + onChanged(); + } else { + resultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.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 documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.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 documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.Builder + getResultsBuilder(int index) { + return getResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResultOrBuilder + getResultsOrBuilder(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResultOrBuilder> + getResultsOrBuilderList() { + if (resultsBuilder_ != null) { + return resultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(results_); + } + } + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.Builder + addResultsBuilder() { + return getResultsFieldBuilder() + .addBuilder( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult + .getDefaultInstance()); + } + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.Builder + addResultsBuilder(int index) { + return getResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult + .getDefaultInstance()); + } + /** + * + * + *
+     * A list of matched documents. The order represents the ranking.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.Builder> + getResultsBuilderList() { + return getResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResultOrBuilder> + getResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.Builder, + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.FacetOrBuilder> + facetsBuilder_; + + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + public Builder setFacets( + int index, com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + public Builder setFacets( + int index, + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + public Builder addFacets(com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + public Builder addFacets( + int index, com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + public Builder addFacets( + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + public Builder addFacets( + int index, + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.Builder getFacetsBuilder( + int index) { + return getFacetsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + public java.util.List< + ? extends com.google.cloud.discoveryengine.v1alpha.SearchResponse.FacetOrBuilder> + getFacetsOrBuilderList() { + if (facetsBuilder_ != null) { + return facetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(facets_); + } + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.Builder + addFacetsBuilder() { + return getFacetsFieldBuilder() + .addBuilder( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.getDefaultInstance()); + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.Builder addFacetsBuilder( + int index) { + return getFacetsFieldBuilder() + .addBuilder( + index, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.getDefaultInstance()); + } + /** + * + * + *
+     * Results of facets requested by user.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + public java.util.List + getFacetsBuilderList() { + return getFacetsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.FacetOrBuilder> + getFacetsFieldBuilder() { + if (facetsBuilder_ == null) { + facetsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.FacetOrBuilder>( + facets_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + facets_ = null; + } + return facetsBuilder_; + } + + private com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + guidedSearchResult_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResultOrBuilder> + guidedSearchResultBuilder_; + /** + * + * + *
+     * Guided search result.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult guided_search_result = 8; + * + * + * @return Whether the guidedSearchResult field is set. + */ + public boolean hasGuidedSearchResult() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Guided search result.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult guided_search_result = 8; + * + * + * @return The guidedSearchResult. + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + getGuidedSearchResult() { + if (guidedSearchResultBuilder_ == null) { + return guidedSearchResult_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .getDefaultInstance() + : guidedSearchResult_; + } else { + return guidedSearchResultBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Guided search result.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult guided_search_result = 8; + * + */ + public Builder setGuidedSearchResult( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult value) { + if (guidedSearchResultBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + guidedSearchResult_ = value; + } else { + guidedSearchResultBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Guided search result.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult guided_search_result = 8; + * + */ + public Builder setGuidedSearchResult( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.Builder + builderForValue) { + if (guidedSearchResultBuilder_ == null) { + guidedSearchResult_ = builderForValue.build(); + } else { + guidedSearchResultBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Guided search result.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult guided_search_result = 8; + * + */ + public Builder mergeGuidedSearchResult( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult value) { + if (guidedSearchResultBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && guidedSearchResult_ != null + && guidedSearchResult_ + != com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .getDefaultInstance()) { + getGuidedSearchResultBuilder().mergeFrom(value); + } else { + guidedSearchResult_ = value; + } + } else { + guidedSearchResultBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Guided search result.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult guided_search_result = 8; + * + */ + public Builder clearGuidedSearchResult() { + bitField0_ = (bitField0_ & ~0x00000004); + guidedSearchResult_ = null; + if (guidedSearchResultBuilder_ != null) { + guidedSearchResultBuilder_.dispose(); + guidedSearchResultBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Guided search result.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult guided_search_result = 8; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.Builder + getGuidedSearchResultBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getGuidedSearchResultFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Guided search result.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult guided_search_result = 8; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResultOrBuilder + getGuidedSearchResultOrBuilder() { + if (guidedSearchResultBuilder_ != null) { + return guidedSearchResultBuilder_.getMessageOrBuilder(); + } else { + return guidedSearchResult_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + .getDefaultInstance() + : guidedSearchResult_; + } + } + /** + * + * + *
+     * Guided search result.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult guided_search_result = 8; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResultOrBuilder> + getGuidedSearchResultFieldBuilder() { + if (guidedSearchResultBuilder_ == null) { + guidedSearchResultBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse + .GuidedSearchResultOrBuilder>( + getGuidedSearchResult(), getParentForChildren(), isClean()); + guidedSearchResult_ = null; + } + return guidedSearchResultBuilder_; + } + + private int totalSize_; + /** + * + * + *
+     * The estimated total count of matched items irrespective of pagination. The
+     * count of
+     * [results][google.cloud.discoveryengine.v1alpha.SearchResponse.results]
+     * returned by pagination may be less than the
+     * [total_size][google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchResponse.results]
+     * returned by pagination may be less than the
+     * [total_size][google.cloud.discoveryengine.v1alpha.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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The estimated total count of matched items irrespective of pagination. The
+     * count of
+     * [results][google.cloud.discoveryengine.v1alpha.SearchResponse.results]
+     * returned by pagination may be less than the
+     * [total_size][google.cloud.discoveryengine.v1alpha.SearchResponse.total_size]
+     * that matches.
+     * 
+ * + * int32 total_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearTotalSize() { + bitField0_ = (bitField0_ & ~0x00000008); + totalSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object attributionToken_ = ""; + /** + * + * + *
+     * A unique search token. This should be included in the
+     * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] logs resulting
+     * from this search, which enables accurate attribution of search model
+     * performance.
+     * 
+ * + * string attribution_token = 4; + * + * @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.discoveryengine.v1alpha.UserEvent] logs resulting
+     * from this search, which enables accurate attribution of search model
+     * performance.
+     * 
+ * + * string attribution_token = 4; + * + * @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.discoveryengine.v1alpha.UserEvent] logs resulting
+     * from this search, which enables accurate attribution of search model
+     * performance.
+     * 
+ * + * string attribution_token = 4; + * + * @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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * A unique search token. This should be included in the
+     * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] logs resulting
+     * from this search, which enables accurate attribution of search model
+     * performance.
+     * 
+ * + * string attribution_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearAttributionToken() { + attributionToken_ = getDefaultInstance().getAttributionToken(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * A unique search token. This should be included in the
+     * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] logs resulting
+     * from this search, which enables accurate attribution of search model
+     * performance.
+     * 
+ * + * string attribution_token = 4; + * + * @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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object redirectUri_ = ""; + /** + * + * + *
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search is performed, and only
+     * [redirect_uri][google.cloud.discoveryengine.v1alpha.SearchResponse.redirect_uri]
+     * and
+     * [attribution_token][google.cloud.discoveryengine.v1alpha.SearchResponse.attribution_token]
+     * are set in the response.
+     * 
+ * + * string redirect_uri = 12; + * + * @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 is performed, and only
+     * [redirect_uri][google.cloud.discoveryengine.v1alpha.SearchResponse.redirect_uri]
+     * and
+     * [attribution_token][google.cloud.discoveryengine.v1alpha.SearchResponse.attribution_token]
+     * are set in the response.
+     * 
+ * + * string redirect_uri = 12; + * + * @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 is performed, and only
+     * [redirect_uri][google.cloud.discoveryengine.v1alpha.SearchResponse.redirect_uri]
+     * and
+     * [attribution_token][google.cloud.discoveryengine.v1alpha.SearchResponse.attribution_token]
+     * are set in the response.
+     * 
+ * + * string redirect_uri = 12; + * + * @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; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search is performed, and only
+     * [redirect_uri][google.cloud.discoveryengine.v1alpha.SearchResponse.redirect_uri]
+     * and
+     * [attribution_token][google.cloud.discoveryengine.v1alpha.SearchResponse.attribution_token]
+     * are set in the response.
+     * 
+ * + * string redirect_uri = 12; + * + * @return This builder for chaining. + */ + public Builder clearRedirectUri() { + redirectUri_ = getDefaultInstance().getRedirectUri(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * The URI of a customer-defined redirect page. If redirect action is
+     * triggered, no search is performed, and only
+     * [redirect_uri][google.cloud.discoveryengine.v1alpha.SearchResponse.redirect_uri]
+     * and
+     * [attribution_token][google.cloud.discoveryengine.v1alpha.SearchResponse.attribution_token]
+     * are set in the response.
+     * 
+ * + * string redirect_uri = 12; + * + * @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; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token that can be sent as
+     * [SearchRequest.page_token][google.cloud.discoveryengine.v1alpha.SearchRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 5; + * + * @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.discoveryengine.v1alpha.SearchRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 5; + * + * @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.discoveryengine.v1alpha.SearchRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 5; + * + * @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; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * A token that can be sent as
+     * [SearchRequest.page_token][google.cloud.discoveryengine.v1alpha.SearchRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 5; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * A token that can be sent as
+     * [SearchRequest.page_token][google.cloud.discoveryengine.v1alpha.SearchRequest.page_token]
+     * to retrieve the next page. If this field is omitted, there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 5; + * + * @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; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object correctedQuery_ = ""; + /** + * + * + *
+     * Contains the spell corrected query, if found. If the spell correction type
+     * is AUTOMATIC, then the search results are based on corrected_query.
+     * Otherwise the original query is used for search.
+     * 
+ * + * string corrected_query = 7; + * + * @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; + } + } + /** + * + * + *
+     * Contains the spell corrected query, if found. If the spell correction type
+     * is AUTOMATIC, then the search results are based on corrected_query.
+     * Otherwise the original query is used for search.
+     * 
+ * + * string corrected_query = 7; + * + * @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; + } + } + /** + * + * + *
+     * Contains the spell corrected query, if found. If the spell correction type
+     * is AUTOMATIC, then the search results are based on corrected_query.
+     * Otherwise the original query is used for search.
+     * 
+ * + * string corrected_query = 7; + * + * @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; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Contains the spell corrected query, if found. If the spell correction type
+     * is AUTOMATIC, then the search results are based on corrected_query.
+     * Otherwise the original query is used for search.
+     * 
+ * + * string corrected_query = 7; + * + * @return This builder for chaining. + */ + public Builder clearCorrectedQuery() { + correctedQuery_ = getDefaultInstance().getCorrectedQuery(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * Contains the spell corrected query, if found. If the spell correction type
+     * is AUTOMATIC, then the search results are based on corrected_query.
+     * Otherwise the original query is used for search.
+     * 
+ * + * string corrected_query = 7; + * + * @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; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SummaryOrBuilder> + summaryBuilder_; + /** + * + * + *
+     * A summary as part of the search results.
+     * This field is only returned if
+     * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.summary_spec]
+     * is set.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 9; + * + * @return Whether the summary field is set. + */ + public boolean hasSummary() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+     * A summary as part of the search results.
+     * This field is only returned if
+     * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.summary_spec]
+     * is set.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 9; + * + * @return The summary. + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary getSummary() { + if (summaryBuilder_ == null) { + return summary_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.getDefaultInstance() + : summary_; + } else { + return summaryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A summary as part of the search results.
+     * This field is only returned if
+     * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.summary_spec]
+     * is set.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 9; + */ + public Builder setSummary( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary value) { + if (summaryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + summary_ = value; + } else { + summaryBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * A summary as part of the search results.
+     * This field is only returned if
+     * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.summary_spec]
+     * is set.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 9; + */ + public Builder setSummary( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Builder builderForValue) { + if (summaryBuilder_ == null) { + summary_ = builderForValue.build(); + } else { + summaryBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * A summary as part of the search results.
+     * This field is only returned if
+     * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.summary_spec]
+     * is set.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 9; + */ + public Builder mergeSummary( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary value) { + if (summaryBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && summary_ != null + && summary_ + != com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary + .getDefaultInstance()) { + getSummaryBuilder().mergeFrom(value); + } else { + summary_ = value; + } + } else { + summaryBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * A summary as part of the search results.
+     * This field is only returned if
+     * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.summary_spec]
+     * is set.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 9; + */ + public Builder clearSummary() { + bitField0_ = (bitField0_ & ~0x00000100); + summary_ = null; + if (summaryBuilder_ != null) { + summaryBuilder_.dispose(); + summaryBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * A summary as part of the search results.
+     * This field is only returned if
+     * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.summary_spec]
+     * is set.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 9; + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Builder + getSummaryBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getSummaryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A summary as part of the search results.
+     * This field is only returned if
+     * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.summary_spec]
+     * is set.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 9; + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.SummaryOrBuilder + getSummaryOrBuilder() { + if (summaryBuilder_ != null) { + return summaryBuilder_.getMessageOrBuilder(); + } else { + return summary_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.getDefaultInstance() + : summary_; + } + } + /** + * + * + *
+     * A summary as part of the search results.
+     * This field is only returned if
+     * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.summary_spec]
+     * is set.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SummaryOrBuilder> + getSummaryFieldBuilder() { + if (summaryBuilder_ == null) { + summaryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SummaryOrBuilder>( + getSummary(), getParentForChildren(), isClean()); + summary_ = null; + } + return summaryBuilder_; + } + + private com.google.protobuf.LazyStringArrayList appliedControls_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureAppliedControlsIsMutable() { + if (!appliedControls_.isModifiable()) { + appliedControls_ = new com.google.protobuf.LazyStringArrayList(appliedControls_); + } + bitField0_ |= 0x00000200; + } + /** + * + * + *
+     * Controls applied as part of the Control service.
+     * 
+ * + * repeated string applied_controls = 10; + * + * @return A list containing the appliedControls. + */ + public com.google.protobuf.ProtocolStringList getAppliedControlsList() { + appliedControls_.makeImmutable(); + return appliedControls_; + } + /** + * + * + *
+     * Controls applied as part of the Control service.
+     * 
+ * + * repeated string applied_controls = 10; + * + * @return The count of appliedControls. + */ + public int getAppliedControlsCount() { + return appliedControls_.size(); + } + /** + * + * + *
+     * Controls applied as part of the Control service.
+     * 
+ * + * repeated string applied_controls = 10; + * + * @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); + } + /** + * + * + *
+     * Controls applied as part of the Control service.
+     * 
+ * + * repeated string applied_controls = 10; + * + * @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); + } + /** + * + * + *
+     * Controls applied as part of the Control service.
+     * 
+ * + * repeated string applied_controls = 10; + * + * @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); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Controls applied as part of the Control service.
+     * 
+ * + * repeated string applied_controls = 10; + * + * @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); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Controls applied as part of the Control service.
+     * 
+ * + * repeated string applied_controls = 10; + * + * @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_); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Controls applied as part of the Control service.
+     * 
+ * + * repeated string applied_controls = 10; + * + * @return This builder for chaining. + */ + public Builder clearAppliedControls() { + appliedControls_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Controls applied as part of the Control service.
+     * 
+ * + * repeated string applied_controls = 10; + * + * @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); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo> + geoSearchDebugInfo_ = java.util.Collections.emptyList(); + + private void ensureGeoSearchDebugInfoIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + geoSearchDebugInfo_ = + new java.util.ArrayList< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo>( + geoSearchDebugInfo_); + bitField0_ |= 0x00000400; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfoOrBuilder> + geoSearchDebugInfoBuilder_; + + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo> + getGeoSearchDebugInfoList() { + if (geoSearchDebugInfoBuilder_ == null) { + return java.util.Collections.unmodifiableList(geoSearchDebugInfo_); + } else { + return geoSearchDebugInfoBuilder_.getMessageList(); + } + } + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + public int getGeoSearchDebugInfoCount() { + if (geoSearchDebugInfoBuilder_ == null) { + return geoSearchDebugInfo_.size(); + } else { + return geoSearchDebugInfoBuilder_.getCount(); + } + } + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + getGeoSearchDebugInfo(int index) { + if (geoSearchDebugInfoBuilder_ == null) { + return geoSearchDebugInfo_.get(index); + } else { + return geoSearchDebugInfoBuilder_.getMessage(index); + } + } + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + public Builder setGeoSearchDebugInfo( + int index, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo value) { + if (geoSearchDebugInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGeoSearchDebugInfoIsMutable(); + geoSearchDebugInfo_.set(index, value); + onChanged(); + } else { + geoSearchDebugInfoBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + public Builder setGeoSearchDebugInfo( + int index, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo.Builder + builderForValue) { + if (geoSearchDebugInfoBuilder_ == null) { + ensureGeoSearchDebugInfoIsMutable(); + geoSearchDebugInfo_.set(index, builderForValue.build()); + onChanged(); + } else { + geoSearchDebugInfoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + public Builder addGeoSearchDebugInfo( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo value) { + if (geoSearchDebugInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGeoSearchDebugInfoIsMutable(); + geoSearchDebugInfo_.add(value); + onChanged(); + } else { + geoSearchDebugInfoBuilder_.addMessage(value); + } + return this; + } + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + public Builder addGeoSearchDebugInfo( + int index, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo value) { + if (geoSearchDebugInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGeoSearchDebugInfoIsMutable(); + geoSearchDebugInfo_.add(index, value); + onChanged(); + } else { + geoSearchDebugInfoBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + public Builder addGeoSearchDebugInfo( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo.Builder + builderForValue) { + if (geoSearchDebugInfoBuilder_ == null) { + ensureGeoSearchDebugInfoIsMutable(); + geoSearchDebugInfo_.add(builderForValue.build()); + onChanged(); + } else { + geoSearchDebugInfoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + public Builder addGeoSearchDebugInfo( + int index, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo.Builder + builderForValue) { + if (geoSearchDebugInfoBuilder_ == null) { + ensureGeoSearchDebugInfoIsMutable(); + geoSearchDebugInfo_.add(index, builderForValue.build()); + onChanged(); + } else { + geoSearchDebugInfoBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + public Builder addAllGeoSearchDebugInfo( + java.lang.Iterable< + ? extends + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo> + values) { + if (geoSearchDebugInfoBuilder_ == null) { + ensureGeoSearchDebugInfoIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, geoSearchDebugInfo_); + onChanged(); + } else { + geoSearchDebugInfoBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + public Builder clearGeoSearchDebugInfo() { + if (geoSearchDebugInfoBuilder_ == null) { + geoSearchDebugInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + } else { + geoSearchDebugInfoBuilder_.clear(); + } + return this; + } + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + public Builder removeGeoSearchDebugInfo(int index) { + if (geoSearchDebugInfoBuilder_ == null) { + ensureGeoSearchDebugInfoIsMutable(); + geoSearchDebugInfo_.remove(index); + onChanged(); + } else { + geoSearchDebugInfoBuilder_.remove(index); + } + return this; + } + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo.Builder + getGeoSearchDebugInfoBuilder(int index) { + return getGeoSearchDebugInfoFieldBuilder().getBuilder(index); + } + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfoOrBuilder + getGeoSearchDebugInfoOrBuilder(int index) { + if (geoSearchDebugInfoBuilder_ == null) { + return geoSearchDebugInfo_.get(index); + } else { + return geoSearchDebugInfoBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + public java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfoOrBuilder> + getGeoSearchDebugInfoOrBuilderList() { + if (geoSearchDebugInfoBuilder_ != null) { + return geoSearchDebugInfoBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(geoSearchDebugInfo_); + } + } + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo.Builder + addGeoSearchDebugInfoBuilder() { + return getGeoSearchDebugInfoFieldBuilder() + .addBuilder( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + .getDefaultInstance()); + } + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo.Builder + addGeoSearchDebugInfoBuilder(int index) { + return getGeoSearchDebugInfoFieldBuilder() + .addBuilder( + index, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo + .getDefaultInstance()); + } + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + public java.util.List< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo.Builder> + getGeoSearchDebugInfoBuilderList() { + return getGeoSearchDebugInfoFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfoOrBuilder> + getGeoSearchDebugInfoFieldBuilder() { + if (geoSearchDebugInfoBuilder_ == null) { + geoSearchDebugInfoBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse + .GeoSearchDebugInfoOrBuilder>( + geoSearchDebugInfo_, + ((bitField0_ & 0x00000400) != 0), + getParentForChildren(), + isClean()); + geoSearchDebugInfo_ = null; + } + return geoSearchDebugInfoBuilder_; + } + + private com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo + queryExpansionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfoOrBuilder> + queryExpansionInfoBuilder_; + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + * + * @return Whether the queryExpansionInfo field is set. + */ + public boolean hasQueryExpansionInfo() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + * + * @return The queryExpansionInfo. + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo + getQueryExpansionInfo() { + if (queryExpansionInfoBuilder_ == null) { + return queryExpansionInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo + .getDefaultInstance() + : queryExpansionInfo_; + } else { + return queryExpansionInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + public Builder setQueryExpansionInfo( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo value) { + if (queryExpansionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryExpansionInfo_ = value; + } else { + queryExpansionInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + public Builder setQueryExpansionInfo( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo.Builder + builderForValue) { + if (queryExpansionInfoBuilder_ == null) { + queryExpansionInfo_ = builderForValue.build(); + } else { + queryExpansionInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + public Builder mergeQueryExpansionInfo( + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo value) { + if (queryExpansionInfoBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && queryExpansionInfo_ != null + && queryExpansionInfo_ + != com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo + .getDefaultInstance()) { + getQueryExpansionInfoBuilder().mergeFrom(value); + } else { + queryExpansionInfo_ = value; + } + } else { + queryExpansionInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + public Builder clearQueryExpansionInfo() { + bitField0_ = (bitField0_ & ~0x00000800); + queryExpansionInfo_ = null; + if (queryExpansionInfoBuilder_ != null) { + queryExpansionInfoBuilder_.dispose(); + queryExpansionInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo.Builder + getQueryExpansionInfoBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return getQueryExpansionInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfoOrBuilder + getQueryExpansionInfoOrBuilder() { + if (queryExpansionInfoBuilder_ != null) { + return queryExpansionInfoBuilder_.getMessageOrBuilder(); + } else { + return queryExpansionInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo + .getDefaultInstance() + : queryExpansionInfo_; + } + } + /** + * + * + *
+     * Query expansion information for the returned results.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfoOrBuilder> + getQueryExpansionInfoFieldBuilder() { + if (queryExpansionInfoBuilder_ == null) { + queryExpansionInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo, + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchResponse + .QueryExpansionInfoOrBuilder>( + getQueryExpansionInfo(), getParentForChildren(), isClean()); + queryExpansionInfo_ = null; + } + return queryExpansionInfoBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.SearchResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.SearchResponse) + private static final com.google.cloud.discoveryengine.v1alpha.SearchResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.SearchResponse(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchResponseOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchResponseOrBuilder.java new file mode 100644 index 000000000000..1b23ad2af19e --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchResponseOrBuilder.java @@ -0,0 +1,500 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/search_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface SearchResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.SearchResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of matched documents. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + java.util.List + getResultsList(); + /** + * + * + *
+   * A list of matched documents. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult getResults(int index); + /** + * + * + *
+   * A list of matched documents. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + int getResultsCount(); + /** + * + * + *
+   * A list of matched documents. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + java.util.List< + ? extends com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResultOrBuilder> + getResultsOrBuilderList(); + /** + * + * + *
+   * A list of matched documents. The order represents the ranking.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult results = 1; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResultOrBuilder getResultsOrBuilder( + int index); + + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + java.util.List getFacetsList(); + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Facet getFacets(int index); + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + int getFacetsCount(); + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + java.util.List + getFacetsOrBuilderList(); + /** + * + * + *
+   * Results of facets requested by user.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.Facet facets = 2; + */ + com.google.cloud.discoveryengine.v1alpha.SearchResponse.FacetOrBuilder getFacetsOrBuilder( + int index); + + /** + * + * + *
+   * Guided search result.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult guided_search_result = 8; + * + * + * @return Whether the guidedSearchResult field is set. + */ + boolean hasGuidedSearchResult(); + /** + * + * + *
+   * Guided search result.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult guided_search_result = 8; + * + * + * @return The guidedSearchResult. + */ + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult + getGuidedSearchResult(); + /** + * + * + *
+   * Guided search result.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResult guided_search_result = 8; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GuidedSearchResultOrBuilder + getGuidedSearchResultOrBuilder(); + + /** + * + * + *
+   * The estimated total count of matched items irrespective of pagination. The
+   * count of
+   * [results][google.cloud.discoveryengine.v1alpha.SearchResponse.results]
+   * returned by pagination may be less than the
+   * [total_size][google.cloud.discoveryengine.v1alpha.SearchResponse.total_size]
+   * that matches.
+   * 
+ * + * int32 total_size = 3; + * + * @return The totalSize. + */ + int getTotalSize(); + + /** + * + * + *
+   * A unique search token. This should be included in the
+   * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] logs resulting
+   * from this search, which enables accurate attribution of search model
+   * performance.
+   * 
+ * + * string attribution_token = 4; + * + * @return The attributionToken. + */ + java.lang.String getAttributionToken(); + /** + * + * + *
+   * A unique search token. This should be included in the
+   * [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] logs resulting
+   * from this search, which enables accurate attribution of search model
+   * performance.
+   * 
+ * + * string attribution_token = 4; + * + * @return The bytes for attributionToken. + */ + com.google.protobuf.ByteString getAttributionTokenBytes(); + + /** + * + * + *
+   * The URI of a customer-defined redirect page. If redirect action is
+   * triggered, no search is performed, and only
+   * [redirect_uri][google.cloud.discoveryengine.v1alpha.SearchResponse.redirect_uri]
+   * and
+   * [attribution_token][google.cloud.discoveryengine.v1alpha.SearchResponse.attribution_token]
+   * are set in the response.
+   * 
+ * + * string redirect_uri = 12; + * + * @return The redirectUri. + */ + java.lang.String getRedirectUri(); + /** + * + * + *
+   * The URI of a customer-defined redirect page. If redirect action is
+   * triggered, no search is performed, and only
+   * [redirect_uri][google.cloud.discoveryengine.v1alpha.SearchResponse.redirect_uri]
+   * and
+   * [attribution_token][google.cloud.discoveryengine.v1alpha.SearchResponse.attribution_token]
+   * are set in the response.
+   * 
+ * + * string redirect_uri = 12; + * + * @return The bytes for redirectUri. + */ + com.google.protobuf.ByteString getRedirectUriBytes(); + + /** + * + * + *
+   * A token that can be sent as
+   * [SearchRequest.page_token][google.cloud.discoveryengine.v1alpha.SearchRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 5; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token that can be sent as
+   * [SearchRequest.page_token][google.cloud.discoveryengine.v1alpha.SearchRequest.page_token]
+   * to retrieve the next page. If this field is omitted, there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 5; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Contains the spell corrected query, if found. If the spell correction type
+   * is AUTOMATIC, then the search results are based on corrected_query.
+   * Otherwise the original query is used for search.
+   * 
+ * + * string corrected_query = 7; + * + * @return The correctedQuery. + */ + java.lang.String getCorrectedQuery(); + /** + * + * + *
+   * Contains the spell corrected query, if found. If the spell correction type
+   * is AUTOMATIC, then the search results are based on corrected_query.
+   * Otherwise the original query is used for search.
+   * 
+ * + * string corrected_query = 7; + * + * @return The bytes for correctedQuery. + */ + com.google.protobuf.ByteString getCorrectedQueryBytes(); + + /** + * + * + *
+   * A summary as part of the search results.
+   * This field is only returned if
+   * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.summary_spec]
+   * is set.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 9; + * + * @return Whether the summary field is set. + */ + boolean hasSummary(); + /** + * + * + *
+   * A summary as part of the search results.
+   * This field is only returned if
+   * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.summary_spec]
+   * is set.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 9; + * + * @return The summary. + */ + com.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary getSummary(); + /** + * + * + *
+   * A summary as part of the search results.
+   * This field is only returned if
+   * [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.summary_spec]
+   * is set.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.Summary summary = 9; + */ + com.google.cloud.discoveryengine.v1alpha.SearchResponse.SummaryOrBuilder getSummaryOrBuilder(); + + /** + * + * + *
+   * Controls applied as part of the Control service.
+   * 
+ * + * repeated string applied_controls = 10; + * + * @return A list containing the appliedControls. + */ + java.util.List getAppliedControlsList(); + /** + * + * + *
+   * Controls applied as part of the Control service.
+   * 
+ * + * repeated string applied_controls = 10; + * + * @return The count of appliedControls. + */ + int getAppliedControlsCount(); + /** + * + * + *
+   * Controls applied as part of the Control service.
+   * 
+ * + * repeated string applied_controls = 10; + * + * @param index The index of the element to return. + * @return The appliedControls at the given index. + */ + java.lang.String getAppliedControls(int index); + /** + * + * + *
+   * Controls applied as part of the Control service.
+   * 
+ * + * repeated string applied_controls = 10; + * + * @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); + + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + java.util.List + getGeoSearchDebugInfoList(); + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo getGeoSearchDebugInfo( + int index); + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + int getGeoSearchDebugInfoCount(); + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + java.util.List< + ? extends + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfoOrBuilder> + getGeoSearchDebugInfoOrBuilderList(); + /** + * + * repeated .google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfo geo_search_debug_info = 16; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchResponse.GeoSearchDebugInfoOrBuilder + getGeoSearchDebugInfoOrBuilder(int index); + + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + * + * @return Whether the queryExpansionInfo field is set. + */ + boolean hasQueryExpansionInfo(); + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + * + * @return The queryExpansionInfo. + */ + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo + getQueryExpansionInfo(); + /** + * + * + *
+   * Query expansion information for the returned results.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfo query_expansion_info = 14; + * + */ + com.google.cloud.discoveryengine.v1alpha.SearchResponse.QueryExpansionInfoOrBuilder + getQueryExpansionInfoOrBuilder(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceProto.java new file mode 100644 index 000000000000..573369e6d4d6 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SearchServiceProto.java @@ -0,0 +1,660 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/search_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +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_discoveryengine_v1alpha_SearchRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ImageQuery_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ImageQuery_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_FacetSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_FacetSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_FacetSpec_FacetKey_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_FacetSpec_FacetKey_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_BoostSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_BoostSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_BoostSpec_ConditionBoostSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_QueryExpansionSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_QueryExpansionSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_SpellCorrectionSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_SpellCorrectionSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_SnippetSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_SnippetSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_SummarySpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_SummarySpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_ExtractiveContentSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_ExtractiveContentSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_EmbeddingSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_EmbeddingSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_EmbeddingSpec_EmbeddingVector_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_EmbeddingSpec_EmbeddingVector_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ParamsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ParamsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_UserLabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_UserLabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_SearchResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_SearchResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_SearchResult_ModelScoresEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_SearchResult_ModelScoresEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Facet_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Facet_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Facet_FacetValue_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Facet_FacetValue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GuidedSearchResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GuidedSearchResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GuidedSearchResult_RefinementAttribute_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GuidedSearchResult_RefinementAttribute_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Summary_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Summary_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Summary_SafetyAttributes_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Summary_SafetyAttributes_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GeoSearchDebugInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GeoSearchDebugInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_QueryExpansionInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_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 = { + "\n9google/cloud/discoveryengine/v1alpha/s" + + "earch_service.proto\022$google.cloud.discov" + + "eryengine.v1alpha\032\034google/api/annotation" + + "s.proto\032\027google/api/client.proto\032\037google" + + "/api/field_behavior.proto\032\031google/api/re" + + "source.proto\0321google/cloud/discoveryengi" + + "ne/v1alpha/common.proto\0323google/cloud/di" + + "scoveryengine/v1alpha/document.proto\032\034go" + + "ogle/protobuf/struct.proto\"\254\032\n\rSearchReq" + + "uest\022M\n\016serving_config\030\001 \001(\tB5\342A\001\002\372A.\n,d" + + "iscoveryengine.googleapis.com/ServingCon" + + "fig\022:\n\006branch\030\002 \001(\tB*\372A\'\n%discoveryengin" + + "e.googleapis.com/Branch\022\r\n\005query\030\003 \001(\t\022S" + + "\n\013image_query\030\023 \001(\0132>.google.cloud.disco" + + "veryengine.v1alpha.SearchRequest.ImageQu" + + "ery\022\021\n\tpage_size\030\004 \001(\005\022\022\n\npage_token\030\005 \001" + + "(\t\022\016\n\006offset\030\006 \001(\005\022\016\n\006filter\030\007 \001(\t\022\020\n\010or" + + "der_by\030\010 \001(\t\022A\n\tuser_info\030\025 \001(\0132..google" + + ".cloud.discoveryengine.v1alpha.UserInfo\022" + + "R\n\013facet_specs\030\t \003(\0132=.google.cloud.disc" + + "overyengine.v1alpha.SearchRequest.FacetS" + + "pec\022Q\n\nboost_spec\030\n \001(\0132=.google.cloud.d" + + "iscoveryengine.v1alpha.SearchRequest.Boo" + + "stSpec\022O\n\006params\030\013 \003(\0132?.google.cloud.di" + + "scoveryengine.v1alpha.SearchRequest.Para" + + "msEntry\022d\n\024query_expansion_spec\030\r \001(\0132F." + + "google.cloud.discoveryengine.v1alpha.Sea" + + "rchRequest.QueryExpansionSpec\022f\n\025spell_c" + + "orrection_spec\030\016 \001(\0132G.google.cloud.disc" + + "overyengine.v1alpha.SearchRequest.SpellC" + + "orrectionSpec\022\026\n\016user_pseudo_id\030\017 \001(\t\022b\n" + + "\023content_search_spec\030\030 \001(\0132E.google.clou" + + "d.discoveryengine.v1alpha.SearchRequest." + + "ContentSearchSpec\022Y\n\016embedding_spec\030\027 \001(" + + "\0132A.google.cloud.discoveryengine.v1alpha" + + ".SearchRequest.EmbeddingSpec\022\032\n\022ranking_" + + "expression\030\032 \001(\t\022\023\n\013safe_search\030\024 \001(\010\022X\n" + + "\013user_labels\030\026 \003(\0132C.google.cloud.discov" + + "eryengine.v1alpha.SearchRequest.UserLabe" + + "lsEntry\032,\n\nImageQuery\022\025\n\013image_bytes\030\001 \001" + + "(\tH\000B\007\n\005image\032\210\003\n\tFacetSpec\022_\n\tfacet_key" + + "\030\001 \001(\0132F.google.cloud.discoveryengine.v1" + + "alpha.SearchRequest.FacetSpec.FacetKeyB\004" + + "\342A\001\002\022\r\n\005limit\030\002 \001(\005\022\034\n\024excluded_filter_k" + + "eys\030\003 \003(\t\022\037\n\027enable_dynamic_position\030\004 \001" + + "(\010\032\313\001\n\010FacetKey\022\021\n\003key\030\001 \001(\tB\004\342A\001\002\022A\n\tin" + + "tervals\030\002 \003(\0132..google.cloud.discoveryen" + + "gine.v1alpha.Interval\022\031\n\021restricted_valu" + + "es\030\003 \003(\t\022\020\n\010prefixes\030\004 \003(\t\022\020\n\010contains\030\005" + + " \003(\t\022\030\n\020case_insensitive\030\006 \001(\010\022\020\n\010order_" + + "by\030\007 \001(\t\032\264\001\n\tBoostSpec\022o\n\025condition_boos" + + "t_specs\030\001 \003(\0132P.google.cloud.discoveryen" + + "gine.v1alpha.SearchRequest.BoostSpec.Con" + + "ditionBoostSpec\0326\n\022ConditionBoostSpec\022\021\n" + + "\tcondition\030\001 \001(\t\022\r\n\005boost\030\002 \001(\002\032\331\001\n\022Quer" + + "yExpansionSpec\022c\n\tcondition\030\001 \001(\0162P.goog" + + "le.cloud.discoveryengine.v1alpha.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\002\032\256\001\n\023SpellCorrectionSpec\022Z\n\004m" + + "ode\030\001 \001(\0162L.google.cloud.discoveryengine" + + ".v1alpha.SearchRequest.SpellCorrectionSp" + + "ec.Mode\";\n\004Mode\022\024\n\020MODE_UNSPECIFIED\020\000\022\023\n" + + "\017SUGGESTION_ONLY\020\001\022\010\n\004AUTO\020\002\032\271\006\n\021Content" + + "SearchSpec\022g\n\014snippet_spec\030\001 \001(\0132Q.googl" + + "e.cloud.discoveryengine.v1alpha.SearchRe" + + "quest.ContentSearchSpec.SnippetSpec\022g\n\014s" + + "ummary_spec\030\002 \001(\0132Q.google.cloud.discove" + + "ryengine.v1alpha.SearchRequest.ContentSe" + + "archSpec.SummarySpec\022|\n\027extractive_conte" + + "nt_spec\030\003 \001(\0132[.google.cloud.discoveryen" + + "gine.v1alpha.SearchRequest.ContentSearch" + + "Spec.ExtractiveContentSpec\032`\n\013SnippetSpe" + + "c\022\035\n\021max_snippet_count\030\001 \001(\005B\002\030\001\022\032\n\016refe" + + "rence_only\030\002 \001(\010B\002\030\001\022\026\n\016return_snippet\030\003" + + " \001(\010\032\251\001\n\013SummarySpec\022\034\n\024summary_result_c" + + "ount\030\001 \001(\005\022\031\n\021include_citations\030\002 \001(\010\022 \n" + + "\030ignore_adversarial_query\030\003 \001(\010\022(\n ignor" + + "e_non_summary_seeking_query\030\004 \001(\010\022\025\n\rlan" + + "guage_code\030\006 \001(\t\032\305\001\n\025ExtractiveContentSp" + + "ec\022#\n\033max_extractive_answer_count\030\001 \001(\005\022" + + "$\n\034max_extractive_segment_count\030\002 \001(\005\022\'\n" + + "\037return_extractive_segment_score\030\003 \001(\010\022\035" + + "\n\025num_previous_segments\030\004 \001(\005\022\031\n\021num_nex" + + "t_segments\030\005 \001(\005\032\264\001\n\rEmbeddingSpec\022l\n\021em" + + "bedding_vectors\030\001 \003(\0132Q.google.cloud.dis" + + "coveryengine.v1alpha.SearchRequest.Embed" + + "dingSpec.EmbeddingVector\0325\n\017EmbeddingVec" + + "tor\022\022\n\nfield_path\030\001 \001(\t\022\016\n\006vector\030\002 \003(\002\032" + + "E\n\013ParamsEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001" + + "(\0132\026.google.protobuf.Value:\0028\001\0321\n\017UserLa" + + "belsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028" + + "\001\"\245\021\n\016SearchResponse\022R\n\007results\030\001 \003(\0132A." + + "google.cloud.discoveryengine.v1alpha.Sea" + + "rchResponse.SearchResult\022J\n\006facets\030\002 \003(\013" + + "2:.google.cloud.discoveryengine.v1alpha." + + "SearchResponse.Facet\022e\n\024guided_search_re" + + "sult\030\010 \001(\0132G.google.cloud.discoveryengin" + + "e.v1alpha.SearchResponse.GuidedSearchRes" + + "ult\022\022\n\ntotal_size\030\003 \001(\005\022\031\n\021attribution_t" + + "oken\030\004 \001(\t\022\024\n\014redirect_uri\030\014 \001(\t\022\027\n\017next" + + "_page_token\030\005 \001(\t\022\027\n\017corrected_query\030\007 \001" + + "(\t\022M\n\007summary\030\t \001(\0132<.google.cloud.disco" + + "veryengine.v1alpha.SearchResponse.Summar" + + "y\022\030\n\020applied_controls\030\n \003(\t\022f\n\025geo_searc" + + "h_debug_info\030\020 \003(\0132G.google.cloud.discov" + + "eryengine.v1alpha.SearchResponse.GeoSear" + + "chDebugInfo\022e\n\024query_expansion_info\030\016 \001(" + + "\0132G.google.cloud.discoveryengine.v1alpha" + + ".SearchResponse.QueryExpansionInfo\032\254\002\n\014S" + + "earchResult\022\n\n\002id\030\001 \001(\t\022@\n\010document\030\002 \001(" + + "\0132..google.cloud.discoveryengine.v1alpha" + + ".Document\022h\n\014model_scores\030\004 \003(\0132R.google" + + ".cloud.discoveryengine.v1alpha.SearchRes" + + "ponse.SearchResult.ModelScoresEntry\032d\n\020M" + + "odelScoresEntry\022\013\n\003key\030\001 \001(\t\022?\n\005value\030\002 " + + "\001(\01320.google.cloud.discoveryengine.v1alp" + + "ha.DoubleList:\0028\001\032\203\002\n\005Facet\022\013\n\003key\030\001 \001(\t" + + "\022U\n\006values\030\002 \003(\0132E.google.cloud.discover" + + "yengine.v1alpha.SearchResponse.Facet.Fac" + + "etValue\022\025\n\rdynamic_facet\030\003 \001(\010\032\177\n\nFacetV" + + "alue\022\017\n\005value\030\001 \001(\tH\000\022B\n\010interval\030\002 \001(\0132" + + "..google.cloud.discoveryengine.v1alpha.I" + + "ntervalH\000\022\r\n\005count\030\003 \001(\003B\r\n\013facet_value\032" + + "\364\001\n\022GuidedSearchResult\022z\n\025refinement_att" + + "ributes\030\001 \003(\0132[.google.cloud.discoveryen" + + "gine.v1alpha.SearchResponse.GuidedSearch" + + "Result.RefinementAttribute\022\033\n\023follow_up_" + + "questions\030\002 \003(\t\032E\n\023RefinementAttribute\022\025" + + "\n\rattribute_key\030\001 \001(\t\022\027\n\017attribute_value" + + "\030\002 \001(\t\032\230\004\n\007Summary\022\024\n\014summary_text\030\001 \001(\t" + + "\022r\n\027summary_skipped_reasons\030\002 \003(\0162Q.goog" + + "le.cloud.discoveryengine.v1alpha.SearchR" + + "esponse.Summary.SummarySkippedReason\022h\n\021" + + "safety_attributes\030\003 \001(\0132M.google.cloud.d" + + "iscoveryengine.v1alpha.SearchResponse.Su" + + "mmary.SafetyAttributes\0326\n\020SafetyAttribut" + + "es\022\022\n\ncategories\030\001 \003(\t\022\016\n\006scores\030\002 \003(\002\"\340" + + "\001\n\024SummarySkippedReason\022&\n\"SUMMARY_SKIPP" + + "ED_REASON_UNSPECIFIED\020\000\022\035\n\031ADVERSARIAL_Q" + + "UERY_IGNORED\020\001\022%\n!NON_SUMMARY_SEEKING_QU" + + "ERY_IGNORED\020\002\022\037\n\033OUT_OF_DOMAIN_QUERY_IGN" + + "ORED\020\003\022\036\n\032POTENTIAL_POLICY_VIOLATION\020\004\022\031" + + "\n\025LLM_ADDON_NOT_ENABLED\020\005\032K\n\022GeoSearchDe" + + "bugInfo\022\036\n\026original_address_query\030\001 \001(\t\022" + + "\025\n\rerror_message\030\002 \001(\t\032I\n\022QueryExpansion" + + "Info\022\026\n\016expanded_query\030\001 \001(\010\022\033\n\023pinned_r" + + "esult_count\030\002 \001(\0032\216\004\n\rSearchService\022\250\003\n\006" + + "Search\0223.google.cloud.discoveryengine.v1" + + "alpha.SearchRequest\0324.google.cloud.disco" + + "veryengine.v1alpha.SearchResponse\"\262\002\202\323\344\223" + + "\002\253\002\"U/v1alpha/{serving_config=projects/*" + + "/locations/*/dataStores/*/servingConfigs" + + "/*}:search:\001*Zh\"c/v1alpha/{serving_confi" + + "g=projects/*/locations/*/collections/*/d" + + "ataStores/*/servingConfigs/*}:search:\001*Z" + + "e\"`/v1alpha/{serving_config=projects/*/l" + + "ocations/*/collections/*/engines/*/servi" + + "ngConfigs/*}:search:\001*\032R\312A\036discoveryengi" + + "ne.googleapis.com\322A.https://www.googleap" + + "is.com/auth/cloud-platformB\236\002\n(com.googl" + + "e.cloud.discoveryengine.v1alphaB\022SearchS" + + "erviceProtoP\001ZRcloud.google.com/go/disco" + + "veryengine/apiv1alpha/discoveryenginepb;" + + "discoveryenginepb\242\002\017DISCOVERYENGINE\252\002$Go" + + "ogle.Cloud.DiscoveryEngine.V1Alpha\312\002$Goo" + + "gle\\Cloud\\DiscoveryEngine\\V1alpha\352\002\'Goog" + + "le::Cloud::DiscoveryEngine::V1alphab\006pro" + + "to3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.discoveryengine.v1alpha.CommonProto.getDescriptor(), + com.google.cloud.discoveryengine.v1alpha.DocumentProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_descriptor, + new java.lang.String[] { + "ServingConfig", + "Branch", + "Query", + "ImageQuery", + "PageSize", + "PageToken", + "Offset", + "Filter", + "OrderBy", + "UserInfo", + "FacetSpecs", + "BoostSpec", + "Params", + "QueryExpansionSpec", + "SpellCorrectionSpec", + "UserPseudoId", + "ContentSearchSpec", + "EmbeddingSpec", + "RankingExpression", + "SafeSearch", + "UserLabels", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ImageQuery_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ImageQuery_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ImageQuery_descriptor, + new java.lang.String[] { + "ImageBytes", "Image", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_FacetSpec_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_FacetSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_FacetSpec_descriptor, + new java.lang.String[] { + "FacetKey", "Limit", "ExcludedFilterKeys", "EnableDynamicPosition", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_FacetSpec_FacetKey_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_FacetSpec_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_FacetSpec_FacetKey_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_FacetSpec_FacetKey_descriptor, + new java.lang.String[] { + "Key", + "Intervals", + "RestrictedValues", + "Prefixes", + "Contains", + "CaseInsensitive", + "OrderBy", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_BoostSpec_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_BoostSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_BoostSpec_descriptor, + new java.lang.String[] { + "ConditionBoostSpecs", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_BoostSpec_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_BoostSpec_ConditionBoostSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_BoostSpec_ConditionBoostSpec_descriptor, + new java.lang.String[] { + "Condition", "Boost", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_QueryExpansionSpec_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_descriptor + .getNestedTypes() + .get(3); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_QueryExpansionSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_QueryExpansionSpec_descriptor, + new java.lang.String[] { + "Condition", "PinUnexpandedResults", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_SpellCorrectionSpec_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_descriptor + .getNestedTypes() + .get(4); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_SpellCorrectionSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_SpellCorrectionSpec_descriptor, + new java.lang.String[] { + "Mode", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_descriptor + .getNestedTypes() + .get(5); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_descriptor, + new java.lang.String[] { + "SnippetSpec", "SummarySpec", "ExtractiveContentSpec", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_SnippetSpec_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_SnippetSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_SnippetSpec_descriptor, + new java.lang.String[] { + "MaxSnippetCount", "ReferenceOnly", "ReturnSnippet", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_SummarySpec_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_SummarySpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_SummarySpec_descriptor, + new java.lang.String[] { + "SummaryResultCount", + "IncludeCitations", + "IgnoreAdversarialQuery", + "IgnoreNonSummarySeekingQuery", + "LanguageCode", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_ExtractiveContentSpec_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_ExtractiveContentSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ContentSearchSpec_ExtractiveContentSpec_descriptor, + new java.lang.String[] { + "MaxExtractiveAnswerCount", + "MaxExtractiveSegmentCount", + "ReturnExtractiveSegmentScore", + "NumPreviousSegments", + "NumNextSegments", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_EmbeddingSpec_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_descriptor + .getNestedTypes() + .get(6); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_EmbeddingSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_EmbeddingSpec_descriptor, + new java.lang.String[] { + "EmbeddingVectors", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_EmbeddingSpec_EmbeddingVector_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_EmbeddingSpec_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_EmbeddingSpec_EmbeddingVector_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_EmbeddingSpec_EmbeddingVector_descriptor, + new java.lang.String[] { + "FieldPath", "Vector", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ParamsEntry_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_descriptor + .getNestedTypes() + .get(7); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ParamsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_ParamsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_UserLabelsEntry_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_descriptor + .getNestedTypes() + .get(8); + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_UserLabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchRequest_UserLabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_descriptor, + new java.lang.String[] { + "Results", + "Facets", + "GuidedSearchResult", + "TotalSize", + "AttributionToken", + "RedirectUri", + "NextPageToken", + "CorrectedQuery", + "Summary", + "AppliedControls", + "GeoSearchDebugInfo", + "QueryExpansionInfo", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_SearchResult_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_SearchResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_SearchResult_descriptor, + new java.lang.String[] { + "Id", "Document", "ModelScores", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_SearchResult_ModelScoresEntry_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_SearchResult_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_SearchResult_ModelScoresEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_SearchResult_ModelScoresEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Facet_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Facet_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Facet_descriptor, + new java.lang.String[] { + "Key", "Values", "DynamicFacet", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Facet_FacetValue_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Facet_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Facet_FacetValue_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Facet_FacetValue_descriptor, + new java.lang.String[] { + "Value", "Interval", "Count", "FacetValue", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GuidedSearchResult_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GuidedSearchResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GuidedSearchResult_descriptor, + new java.lang.String[] { + "RefinementAttributes", "FollowUpQuestions", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GuidedSearchResult_RefinementAttribute_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GuidedSearchResult_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GuidedSearchResult_RefinementAttribute_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GuidedSearchResult_RefinementAttribute_descriptor, + new java.lang.String[] { + "AttributeKey", "AttributeValue", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Summary_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_descriptor + .getNestedTypes() + .get(3); + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Summary_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Summary_descriptor, + new java.lang.String[] { + "SummaryText", "SummarySkippedReasons", "SafetyAttributes", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Summary_SafetyAttributes_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Summary_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Summary_SafetyAttributes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_Summary_SafetyAttributes_descriptor, + new java.lang.String[] { + "Categories", "Scores", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GeoSearchDebugInfo_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_descriptor + .getNestedTypes() + .get(4); + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GeoSearchDebugInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_GeoSearchDebugInfo_descriptor, + new java.lang.String[] { + "OriginalAddressQuery", "ErrorMessage", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_QueryExpansionInfo_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_descriptor + .getNestedTypes() + .get(5); + internal_static_google_cloud_discoveryengine_v1alpha_SearchResponse_QueryExpansionInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_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.discoveryengine.v1alpha.CommonProto.getDescriptor(); + com.google.cloud.discoveryengine.v1alpha.DocumentProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ServingConfigName.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ServingConfigName.java new file mode 100644 index 000000000000..b1188c1dc2c6 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/ServingConfigName.java @@ -0,0 +1,566 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +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_DATA_STORE_SERVING_CONFIG = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}"); + private static final PathTemplate PROJECT_LOCATION_COLLECTION_DATA_STORE_SERVING_CONFIG = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}"); + private static final PathTemplate PROJECT_LOCATION_COLLECTION_ENGINE_SERVING_CONFIG = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String dataStore; + private final String servingConfig; + private final String collection; + private final String engine; + + @Deprecated + protected ServingConfigName() { + project = null; + location = null; + dataStore = null; + servingConfig = null; + collection = null; + engine = null; + } + + private ServingConfigName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + dataStore = Preconditions.checkNotNull(builder.getDataStore()); + servingConfig = Preconditions.checkNotNull(builder.getServingConfig()); + collection = null; + engine = null; + pathTemplate = PROJECT_LOCATION_DATA_STORE_SERVING_CONFIG; + } + + private ServingConfigName(ProjectLocationCollectionDataStoreServingConfigBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + collection = Preconditions.checkNotNull(builder.getCollection()); + dataStore = Preconditions.checkNotNull(builder.getDataStore()); + servingConfig = Preconditions.checkNotNull(builder.getServingConfig()); + engine = null; + pathTemplate = PROJECT_LOCATION_COLLECTION_DATA_STORE_SERVING_CONFIG; + } + + private ServingConfigName(ProjectLocationCollectionEngineServingConfigBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + collection = Preconditions.checkNotNull(builder.getCollection()); + engine = Preconditions.checkNotNull(builder.getEngine()); + servingConfig = Preconditions.checkNotNull(builder.getServingConfig()); + dataStore = null; + pathTemplate = PROJECT_LOCATION_COLLECTION_ENGINE_SERVING_CONFIG; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataStore() { + return dataStore; + } + + public String getServingConfig() { + return servingConfig; + } + + public String getCollection() { + return collection; + } + + public String getEngine() { + return engine; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectLocationDataStoreServingConfigBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static ProjectLocationCollectionDataStoreServingConfigBuilder + newProjectLocationCollectionDataStoreServingConfigBuilder() { + return new ProjectLocationCollectionDataStoreServingConfigBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static ProjectLocationCollectionEngineServingConfigBuilder + newProjectLocationCollectionEngineServingConfigBuilder() { + return new ProjectLocationCollectionEngineServingConfigBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ServingConfigName of( + String project, String location, String dataStore, String servingConfig) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setServingConfig(servingConfig) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static ServingConfigName ofProjectLocationDataStoreServingConfigName( + String project, String location, String dataStore, String servingConfig) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setServingConfig(servingConfig) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static ServingConfigName ofProjectLocationCollectionDataStoreServingConfigName( + String project, String location, String collection, String dataStore, String servingConfig) { + return newProjectLocationCollectionDataStoreServingConfigBuilder() + .setProject(project) + .setLocation(location) + .setCollection(collection) + .setDataStore(dataStore) + .setServingConfig(servingConfig) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static ServingConfigName ofProjectLocationCollectionEngineServingConfigName( + String project, String location, String collection, String engine, String servingConfig) { + return newProjectLocationCollectionEngineServingConfigBuilder() + .setProject(project) + .setLocation(location) + .setCollection(collection) + .setEngine(engine) + .setServingConfig(servingConfig) + .build(); + } + + public static String format( + String project, String location, String dataStore, String servingConfig) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setServingConfig(servingConfig) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationDataStoreServingConfigName( + String project, String location, String dataStore, String servingConfig) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .setServingConfig(servingConfig) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationCollectionDataStoreServingConfigName( + String project, String location, String collection, String dataStore, String servingConfig) { + return newProjectLocationCollectionDataStoreServingConfigBuilder() + .setProject(project) + .setLocation(location) + .setCollection(collection) + .setDataStore(dataStore) + .setServingConfig(servingConfig) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationCollectionEngineServingConfigName( + String project, String location, String collection, String engine, String servingConfig) { + return newProjectLocationCollectionEngineServingConfigBuilder() + .setProject(project) + .setLocation(location) + .setCollection(collection) + .setEngine(engine) + .setServingConfig(servingConfig) + .build() + .toString(); + } + + public static ServingConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_DATA_STORE_SERVING_CONFIG.matches(formattedString)) { + Map matchMap = + PROJECT_LOCATION_DATA_STORE_SERVING_CONFIG.match(formattedString); + return ofProjectLocationDataStoreServingConfigName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("data_store"), + matchMap.get("serving_config")); + } else if (PROJECT_LOCATION_COLLECTION_DATA_STORE_SERVING_CONFIG.matches(formattedString)) { + Map matchMap = + PROJECT_LOCATION_COLLECTION_DATA_STORE_SERVING_CONFIG.match(formattedString); + return ofProjectLocationCollectionDataStoreServingConfigName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("collection"), + matchMap.get("data_store"), + matchMap.get("serving_config")); + } else if (PROJECT_LOCATION_COLLECTION_ENGINE_SERVING_CONFIG.matches(formattedString)) { + Map matchMap = + PROJECT_LOCATION_COLLECTION_ENGINE_SERVING_CONFIG.match(formattedString); + return ofProjectLocationCollectionEngineServingConfigName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("collection"), + matchMap.get("engine"), + matchMap.get("serving_config")); + } + throw new ValidationException("ServingConfigName.parse: formattedString not in valid format"); + } + + 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_DATA_STORE_SERVING_CONFIG.matches(formattedString) + || PROJECT_LOCATION_COLLECTION_DATA_STORE_SERVING_CONFIG.matches(formattedString) + || PROJECT_LOCATION_COLLECTION_ENGINE_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 (dataStore != null) { + fieldMapBuilder.put("data_store", dataStore); + } + if (servingConfig != null) { + fieldMapBuilder.put("serving_config", servingConfig); + } + if (collection != null) { + fieldMapBuilder.put("collection", collection); + } + if (engine != null) { + fieldMapBuilder.put("engine", engine); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @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.dataStore, that.dataStore) + && Objects.equals(this.servingConfig, that.servingConfig) + && Objects.equals(this.collection, that.collection) + && Objects.equals(this.engine, that.engine); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(dataStore); + h *= 1000003; + h ^= Objects.hashCode(servingConfig); + h *= 1000003; + h ^= Objects.hashCode(collection); + h *= 1000003; + h ^= Objects.hashCode(engine); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}. + */ + public static class Builder { + private String project; + private String location; + private String dataStore; + private String servingConfig; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataStore() { + return dataStore; + } + + 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 setDataStore(String dataStore) { + this.dataStore = dataStore; + return this; + } + + public Builder setServingConfig(String servingConfig) { + this.servingConfig = servingConfig; + return this; + } + + private Builder(ServingConfigName servingConfigName) { + Preconditions.checkArgument( + Objects.equals( + servingConfigName.pathTemplate, PROJECT_LOCATION_DATA_STORE_SERVING_CONFIG), + "toBuilder is only supported when ServingConfigName has the pattern of projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}"); + this.project = servingConfigName.project; + this.location = servingConfigName.location; + this.dataStore = servingConfigName.dataStore; + this.servingConfig = servingConfigName.servingConfig; + } + + public ServingConfigName build() { + return new ServingConfigName(this); + } + } + + /** + * Builder for + * projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}. + */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class ProjectLocationCollectionDataStoreServingConfigBuilder { + private String project; + private String location; + private String collection; + private String dataStore; + private String servingConfig; + + protected ProjectLocationCollectionDataStoreServingConfigBuilder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCollection() { + return collection; + } + + public String getDataStore() { + return dataStore; + } + + public String getServingConfig() { + return servingConfig; + } + + public ProjectLocationCollectionDataStoreServingConfigBuilder setProject(String project) { + this.project = project; + return this; + } + + public ProjectLocationCollectionDataStoreServingConfigBuilder setLocation(String location) { + this.location = location; + return this; + } + + public ProjectLocationCollectionDataStoreServingConfigBuilder setCollection(String collection) { + this.collection = collection; + return this; + } + + public ProjectLocationCollectionDataStoreServingConfigBuilder setDataStore(String dataStore) { + this.dataStore = dataStore; + return this; + } + + public ProjectLocationCollectionDataStoreServingConfigBuilder setServingConfig( + String servingConfig) { + this.servingConfig = servingConfig; + return this; + } + + public ServingConfigName build() { + return new ServingConfigName(this); + } + } + + /** + * Builder for + * projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}. + */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class ProjectLocationCollectionEngineServingConfigBuilder { + private String project; + private String location; + private String collection; + private String engine; + private String servingConfig; + + protected ProjectLocationCollectionEngineServingConfigBuilder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCollection() { + return collection; + } + + public String getEngine() { + return engine; + } + + public String getServingConfig() { + return servingConfig; + } + + public ProjectLocationCollectionEngineServingConfigBuilder setProject(String project) { + this.project = project; + return this; + } + + public ProjectLocationCollectionEngineServingConfigBuilder setLocation(String location) { + this.location = location; + return this; + } + + public ProjectLocationCollectionEngineServingConfigBuilder setCollection(String collection) { + this.collection = collection; + return this; + } + + public ProjectLocationCollectionEngineServingConfigBuilder setEngine(String engine) { + this.engine = engine; + return this; + } + + public ProjectLocationCollectionEngineServingConfigBuilder setServingConfig( + String servingConfig) { + this.servingConfig = servingConfig; + return this; + } + + public ServingConfigName build() { + return new ServingConfigName(this); + } + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineName.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineName.java new file mode 100644 index 000000000000..e50ef4d6758b --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineName.java @@ -0,0 +1,374 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +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 SiteSearchEngineName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_DATA_STORE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine"); + private static final PathTemplate PROJECT_LOCATION_COLLECTION_DATA_STORE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String dataStore; + private final String collection; + + @Deprecated + protected SiteSearchEngineName() { + project = null; + location = null; + dataStore = null; + collection = null; + } + + private SiteSearchEngineName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + dataStore = Preconditions.checkNotNull(builder.getDataStore()); + collection = null; + pathTemplate = PROJECT_LOCATION_DATA_STORE; + } + + private SiteSearchEngineName(ProjectLocationCollectionDataStoreBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + collection = Preconditions.checkNotNull(builder.getCollection()); + dataStore = Preconditions.checkNotNull(builder.getDataStore()); + pathTemplate = PROJECT_LOCATION_COLLECTION_DATA_STORE; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataStore() { + return dataStore; + } + + public String getCollection() { + return collection; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectLocationDataStoreBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static ProjectLocationCollectionDataStoreBuilder + newProjectLocationCollectionDataStoreBuilder() { + return new ProjectLocationCollectionDataStoreBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SiteSearchEngineName of(String project, String location, String dataStore) { + return newBuilder().setProject(project).setLocation(location).setDataStore(dataStore).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static SiteSearchEngineName ofProjectLocationDataStoreName( + String project, String location, String dataStore) { + return newBuilder().setProject(project).setLocation(location).setDataStore(dataStore).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static SiteSearchEngineName ofProjectLocationCollectionDataStoreName( + String project, String location, String collection, String dataStore) { + return newProjectLocationCollectionDataStoreBuilder() + .setProject(project) + .setLocation(location) + .setCollection(collection) + .setDataStore(dataStore) + .build(); + } + + public static String format(String project, String location, String dataStore) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationDataStoreName( + String project, String location, String dataStore) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDataStore(dataStore) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationCollectionDataStoreName( + String project, String location, String collection, String dataStore) { + return newProjectLocationCollectionDataStoreBuilder() + .setProject(project) + .setLocation(location) + .setCollection(collection) + .setDataStore(dataStore) + .build() + .toString(); + } + + public static SiteSearchEngineName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_DATA_STORE.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_DATA_STORE.match(formattedString); + return ofProjectLocationDataStoreName( + matchMap.get("project"), matchMap.get("location"), matchMap.get("data_store")); + } else if (PROJECT_LOCATION_COLLECTION_DATA_STORE.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_COLLECTION_DATA_STORE.match(formattedString); + return ofProjectLocationCollectionDataStoreName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("collection"), + matchMap.get("data_store")); + } + throw new ValidationException( + "SiteSearchEngineName.parse: formattedString not in valid format"); + } + + 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 (SiteSearchEngineName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_DATA_STORE.matches(formattedString) + || PROJECT_LOCATION_COLLECTION_DATA_STORE.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 (dataStore != null) { + fieldMapBuilder.put("data_store", dataStore); + } + if (collection != null) { + fieldMapBuilder.put("collection", collection); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + SiteSearchEngineName that = ((SiteSearchEngineName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.dataStore, that.dataStore) + && Objects.equals(this.collection, that.collection); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(dataStore); + h *= 1000003; + h ^= Objects.hashCode(collection); + return h; + } + + /** + * Builder for projects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine. + */ + public static class Builder { + private String project; + private String location; + private String dataStore; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDataStore() { + return dataStore; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setDataStore(String dataStore) { + this.dataStore = dataStore; + return this; + } + + private Builder(SiteSearchEngineName siteSearchEngineName) { + Preconditions.checkArgument( + Objects.equals(siteSearchEngineName.pathTemplate, PROJECT_LOCATION_DATA_STORE), + "toBuilder is only supported when SiteSearchEngineName has the pattern of projects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine"); + this.project = siteSearchEngineName.project; + this.location = siteSearchEngineName.location; + this.dataStore = siteSearchEngineName.dataStore; + } + + public SiteSearchEngineName build() { + return new SiteSearchEngineName(this); + } + } + + /** + * Builder for + * projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine. + */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class ProjectLocationCollectionDataStoreBuilder { + private String project; + private String location; + private String collection; + private String dataStore; + + protected ProjectLocationCollectionDataStoreBuilder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCollection() { + return collection; + } + + public String getDataStore() { + return dataStore; + } + + public ProjectLocationCollectionDataStoreBuilder setProject(String project) { + this.project = project; + return this; + } + + public ProjectLocationCollectionDataStoreBuilder setLocation(String location) { + this.location = location; + return this; + } + + public ProjectLocationCollectionDataStoreBuilder setCollection(String collection) { + this.collection = collection; + return this; + } + + public ProjectLocationCollectionDataStoreBuilder setDataStore(String dataStore) { + this.dataStore = dataStore; + return this; + } + + public SiteSearchEngineName build() { + return new SiteSearchEngineName(this); + } + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceProto.java new file mode 100644 index 000000000000..b8887b4cff2c --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SiteSearchEngineServiceProto.java @@ -0,0 +1,192 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/site_search_engine_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public final class SiteSearchEngineServiceProto { + private SiteSearchEngineServiceProto() {} + + 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_discoveryengine_v1alpha_RecrawlUrisRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_FailureInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_FailureInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_FailureInfo_FailureReason_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_FailureInfo_FailureReason_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nEgoogle/cloud/discoveryengine/v1alpha/s" + + "ite_search_engine_service.proto\022$google." + + "cloud.discoveryengine.v1alpha\032\034google/ap" + + "i/annotations.proto\032\027google/api/client.p" + + "roto\032\037google/api/field_behavior.proto\032\031g" + + "oogle/api/resource.proto\032#google/longrun" + + "ning/operations.proto\032\037google/protobuf/t" + + "imestamp.proto\"~\n\022RecrawlUrisRequest\022T\n\022" + + "site_search_engine\030\001 \001(\tB8\342A\001\002\372A1\n/disco" + + "veryengine.googleapis.com/SiteSearchEngi" + + "ne\022\022\n\004uris\030\002 \003(\tB\004\342A\001\002\"\367\003\n\023RecrawlUrisRe" + + "sponse\022^\n\017failure_samples\030\001 \003(\0132E.google" + + ".cloud.discoveryengine.v1alpha.RecrawlUr" + + "isResponse.FailureInfo\022\023\n\013failed_uris\030\002 " + + "\003(\t\032\352\002\n\013FailureInfo\022\013\n\003uri\030\001 \001(\t\022l\n\017fail" + + "ure_reasons\030\002 \003(\0132S.google.cloud.discove" + + "ryengine.v1alpha.RecrawlUrisResponse.Fai" + + "lureInfo.FailureReason\032\337\001\n\rFailureReason" + + "\022s\n\013corpus_type\030\001 \001(\0162^.google.cloud.dis" + + "coveryengine.v1alpha.RecrawlUrisResponse" + + ".FailureInfo.FailureReason.CorpusType\022\025\n" + + "\rerror_message\030\002 \001(\t\"B\n\nCorpusType\022\033\n\027CO" + + "RPUS_TYPE_UNSPECIFIED\020\000\022\013\n\007DESKTOP\020\001\022\n\n\006" + + "MOBILE\020\002\"\363\001\n\023RecrawlUrisMetadata\022/\n\013crea" + + "te_time\030\001 \001(\0132\032.google.protobuf.Timestam" + + "p\022/\n\013update_time\030\002 \001(\0132\032.google.protobuf" + + ".Timestamp\022\024\n\014invalid_uris\030\003 \003(\t\022\030\n\020vali" + + "d_uris_count\030\004 \001(\005\022\025\n\rsuccess_count\030\005 \001(" + + "\005\022\025\n\rpending_count\030\006 \001(\005\022\034\n\024quota_exceed" + + "ed_count\030\007 \001(\0052\255\004\n\027SiteSearchEngineServi" + + "ce\022\275\003\n\013RecrawlUris\0228.google.cloud.discov" + + "eryengine.v1alpha.RecrawlUrisRequest\032\035.g" + + "oogle.longrunning.Operation\"\324\002\312At\n8googl" + + "e.cloud.discoveryengine.v1alpha.RecrawlU" + + "risResponse\0228google.cloud.discoveryengin" + + "e.v1alpha.RecrawlUrisMetadata\202\323\344\223\002\326\001\"^/v" + + "1alpha/{site_search_engine=projects/*/lo" + + "cations/*/dataStores/*/siteSearchEngine}" + + ":recrawlUris:\001*Zq\"l/v1alpha/{site_search" + + "_engine=projects/*/locations/*/collectio" + + "ns/*/dataStores/*/siteSearchEngine}:recr" + + "awlUris:\001*\032R\312A\036discoveryengine.googleapi" + + "s.com\322A.https://www.googleapis.com/auth/" + + "cloud-platformB\250\002\n(com.google.cloud.disc" + + "overyengine.v1alphaB\034SiteSearchEngineSer" + + "viceProtoP\001ZRcloud.google.com/go/discove" + + "ryengine/apiv1alpha/discoveryenginepb;di" + + "scoveryenginepb\242\002\017DISCOVERYENGINE\252\002$Goog" + + "le.Cloud.DiscoveryEngine.V1Alpha\312\002$Googl" + + "e\\Cloud\\DiscoveryEngine\\V1alpha\352\002\'Google" + + "::Cloud::DiscoveryEngine::V1alphab\006proto" + + "3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisRequest_descriptor, + new java.lang.String[] { + "SiteSearchEngine", "Uris", + }); + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_descriptor, + new java.lang.String[] { + "FailureSamples", "FailedUris", + }); + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_FailureInfo_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_FailureInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_FailureInfo_descriptor, + new java.lang.String[] { + "Uri", "FailureReasons", + }); + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_FailureInfo_FailureReason_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_FailureInfo_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_FailureInfo_FailureReason_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisResponse_FailureInfo_FailureReason_descriptor, + new java.lang.String[] { + "CorpusType", "ErrorMessage", + }); + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisMetadata_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_RecrawlUrisMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "UpdateTime", + "InvalidUris", + "ValidUrisCount", + "SuccessCount", + "PendingCount", + "QuotaExceededCount", + }); + 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.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SolutionType.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SolutionType.java new file mode 100644 index 000000000000..74fa61af1cbf --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/SolutionType.java @@ -0,0 +1,200 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/common.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * The type of solution.
+ * 
+ * + * Protobuf enum {@code google.cloud.discoveryengine.v1alpha.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 Discovery Search.
+   * 
+ * + * SOLUTION_TYPE_SEARCH = 2; + */ + SOLUTION_TYPE_SEARCH(2), + /** + * + * + *
+   * Used for use cases related to the Generative AI agent.
+   * 
+ * + * SOLUTION_TYPE_CHAT = 3; + */ + SOLUTION_TYPE_CHAT(3), + 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 Discovery Search.
+   * 
+ * + * SOLUTION_TYPE_SEARCH = 2; + */ + public static final int SOLUTION_TYPE_SEARCH_VALUE = 2; + /** + * + * + *
+   * Used for use cases related to the Generative AI agent.
+   * 
+ * + * SOLUTION_TYPE_CHAT = 3; + */ + public static final int SOLUTION_TYPE_CHAT_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 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; + case 3: + return SOLUTION_TYPE_CHAT; + 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.discoveryengine.v1alpha.CommonProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + 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.discoveryengine.v1alpha.SolutionType) +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/TextInput.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/TextInput.java new file mode 100644 index 000000000000..f5610306389c --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/TextInput.java @@ -0,0 +1,895 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversation.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Defines text input.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.TextInput} + */ +public final class TextInput extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.TextInput) + TextInputOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextInput.newBuilder() to construct. + private TextInput(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TextInput() { + input_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TextInput(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_TextInput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_TextInput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.TextInput.class, + com.google.cloud.discoveryengine.v1alpha.TextInput.Builder.class); + } + + public static final int INPUT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object input_ = ""; + /** + * + * + *
+   * Text input.
+   * 
+ * + * string input = 1; + * + * @return The input. + */ + @java.lang.Override + public java.lang.String getInput() { + java.lang.Object ref = input_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + input_ = s; + return s; + } + } + /** + * + * + *
+   * Text input.
+   * 
+ * + * string input = 1; + * + * @return The bytes for input. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInputBytes() { + java.lang.Object ref = input_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + input_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTEXT_FIELD_NUMBER = 2; + private com.google.cloud.discoveryengine.v1alpha.ConversationContext context_; + /** + * + * + *
+   * Conversation context of the input.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ConversationContext context = 2; + * + * @return Whether the context field is set. + */ + @java.lang.Override + public boolean hasContext() { + return context_ != null; + } + /** + * + * + *
+   * Conversation context of the input.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ConversationContext context = 2; + * + * @return The context. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConversationContext getContext() { + return context_ == null + ? com.google.cloud.discoveryengine.v1alpha.ConversationContext.getDefaultInstance() + : context_; + } + /** + * + * + *
+   * Conversation context of the input.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ConversationContext context = 2; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConversationContextOrBuilder + getContextOrBuilder() { + return context_ == null + ? com.google.cloud.discoveryengine.v1alpha.ConversationContext.getDefaultInstance() + : context_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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(input_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, input_); + } + if (context_ != null) { + output.writeMessage(2, getContext()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(input_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, input_); + } + if (context_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getContext()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.TextInput)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.TextInput other = + (com.google.cloud.discoveryengine.v1alpha.TextInput) obj; + + if (!getInput().equals(other.getInput())) return false; + if (hasContext() != other.hasContext()) return false; + if (hasContext()) { + if (!getContext().equals(other.getContext())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + INPUT_FIELD_NUMBER; + hash = (53 * hash) + getInput().hashCode(); + if (hasContext()) { + hash = (37 * hash) + CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getContext().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.TextInput parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.TextInput parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.TextInput parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.TextInput parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.TextInput parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.TextInput parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.TextInput parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.TextInput parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.TextInput parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.TextInput parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.TextInput parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.TextInput parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.discoveryengine.v1alpha.TextInput prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Defines text input.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.TextInput} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.TextInput) + com.google.cloud.discoveryengine.v1alpha.TextInputOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_TextInput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_TextInput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.TextInput.class, + com.google.cloud.discoveryengine.v1alpha.TextInput.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.TextInput.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + input_ = ""; + context_ = null; + if (contextBuilder_ != null) { + contextBuilder_.dispose(); + contextBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ConversationProto + .internal_static_google_cloud_discoveryengine_v1alpha_TextInput_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.TextInput getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.TextInput.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.TextInput build() { + com.google.cloud.discoveryengine.v1alpha.TextInput result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.TextInput buildPartial() { + com.google.cloud.discoveryengine.v1alpha.TextInput result = + new com.google.cloud.discoveryengine.v1alpha.TextInput(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.TextInput result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.input_ = input_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.context_ = contextBuilder_ == null ? context_ : contextBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.TextInput) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.TextInput) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.TextInput other) { + if (other == com.google.cloud.discoveryengine.v1alpha.TextInput.getDefaultInstance()) + return this; + if (!other.getInput().isEmpty()) { + input_ = other.input_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasContext()) { + mergeContext(other.getContext()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object input_ = ""; + /** + * + * + *
+     * Text input.
+     * 
+ * + * string input = 1; + * + * @return The input. + */ + public java.lang.String getInput() { + java.lang.Object ref = input_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + input_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Text input.
+     * 
+ * + * string input = 1; + * + * @return The bytes for input. + */ + public com.google.protobuf.ByteString getInputBytes() { + java.lang.Object ref = input_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + input_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Text input.
+     * 
+ * + * string input = 1; + * + * @param value The input to set. + * @return This builder for chaining. + */ + public Builder setInput(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + input_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Text input.
+     * 
+ * + * string input = 1; + * + * @return This builder for chaining. + */ + public Builder clearInput() { + input_ = getDefaultInstance().getInput(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Text input.
+     * 
+ * + * string input = 1; + * + * @param value The bytes for input to set. + * @return This builder for chaining. + */ + public Builder setInputBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + input_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1alpha.ConversationContext context_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ConversationContext, + com.google.cloud.discoveryengine.v1alpha.ConversationContext.Builder, + com.google.cloud.discoveryengine.v1alpha.ConversationContextOrBuilder> + contextBuilder_; + /** + * + * + *
+     * Conversation context of the input.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ConversationContext context = 2; + * + * @return Whether the context field is set. + */ + public boolean hasContext() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Conversation context of the input.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ConversationContext context = 2; + * + * @return The context. + */ + public com.google.cloud.discoveryengine.v1alpha.ConversationContext getContext() { + if (contextBuilder_ == null) { + return context_ == null + ? com.google.cloud.discoveryengine.v1alpha.ConversationContext.getDefaultInstance() + : context_; + } else { + return contextBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Conversation context of the input.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ConversationContext context = 2; + */ + public Builder setContext(com.google.cloud.discoveryengine.v1alpha.ConversationContext value) { + if (contextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + context_ = value; + } else { + contextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Conversation context of the input.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ConversationContext context = 2; + */ + public Builder setContext( + com.google.cloud.discoveryengine.v1alpha.ConversationContext.Builder builderForValue) { + if (contextBuilder_ == null) { + context_ = builderForValue.build(); + } else { + contextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Conversation context of the input.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ConversationContext context = 2; + */ + public Builder mergeContext( + com.google.cloud.discoveryengine.v1alpha.ConversationContext value) { + if (contextBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && context_ != null + && context_ + != com.google.cloud.discoveryengine.v1alpha.ConversationContext + .getDefaultInstance()) { + getContextBuilder().mergeFrom(value); + } else { + context_ = value; + } + } else { + contextBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Conversation context of the input.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ConversationContext context = 2; + */ + public Builder clearContext() { + bitField0_ = (bitField0_ & ~0x00000002); + context_ = null; + if (contextBuilder_ != null) { + contextBuilder_.dispose(); + contextBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Conversation context of the input.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ConversationContext context = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.ConversationContext.Builder + getContextBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getContextFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Conversation context of the input.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ConversationContext context = 2; + */ + public com.google.cloud.discoveryengine.v1alpha.ConversationContextOrBuilder + getContextOrBuilder() { + if (contextBuilder_ != null) { + return contextBuilder_.getMessageOrBuilder(); + } else { + return context_ == null + ? com.google.cloud.discoveryengine.v1alpha.ConversationContext.getDefaultInstance() + : context_; + } + } + /** + * + * + *
+     * Conversation context of the input.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.ConversationContext context = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ConversationContext, + com.google.cloud.discoveryengine.v1alpha.ConversationContext.Builder, + com.google.cloud.discoveryengine.v1alpha.ConversationContextOrBuilder> + getContextFieldBuilder() { + if (contextBuilder_ == null) { + contextBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.ConversationContext, + com.google.cloud.discoveryengine.v1alpha.ConversationContext.Builder, + com.google.cloud.discoveryengine.v1alpha.ConversationContextOrBuilder>( + getContext(), getParentForChildren(), isClean()); + context_ = null; + } + return contextBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.TextInput) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.TextInput) + private static final com.google.cloud.discoveryengine.v1alpha.TextInput DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.TextInput(); + } + + public static com.google.cloud.discoveryengine.v1alpha.TextInput getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextInput parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.TextInput getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/TextInputOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/TextInputOrBuilder.java new file mode 100644 index 000000000000..97c6e94d1ce1 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/TextInputOrBuilder.java @@ -0,0 +1,85 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversation.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface TextInputOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.TextInput) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Text input.
+   * 
+ * + * string input = 1; + * + * @return The input. + */ + java.lang.String getInput(); + /** + * + * + *
+   * Text input.
+   * 
+ * + * string input = 1; + * + * @return The bytes for input. + */ + com.google.protobuf.ByteString getInputBytes(); + + /** + * + * + *
+   * Conversation context of the input.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ConversationContext context = 2; + * + * @return Whether the context field is set. + */ + boolean hasContext(); + /** + * + * + *
+   * Conversation context of the input.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ConversationContext context = 2; + * + * @return The context. + */ + com.google.cloud.discoveryengine.v1alpha.ConversationContext getContext(); + /** + * + * + *
+   * Conversation context of the input.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.ConversationContext context = 2; + */ + com.google.cloud.discoveryengine.v1alpha.ConversationContextOrBuilder getContextOrBuilder(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/TransactionInfo.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/TransactionInfo.java new file mode 100644 index 000000000000..8573c1d55008 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/TransactionInfo.java @@ -0,0 +1,1504 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/user_event.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * A transaction represents the entire purchase transaction.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.TransactionInfo} + */ +public final class TransactionInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.TransactionInfo) + TransactionInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use TransactionInfo.newBuilder() to construct. + private TransactionInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TransactionInfo() { + currency_ = ""; + transactionId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TransactionInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_TransactionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_TransactionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.TransactionInfo.class, + com.google.cloud.discoveryengine.v1alpha.TransactionInfo.Builder.class); + } + + private int bitField0_; + public static final int VALUE_FIELD_NUMBER = 1; + private float value_ = 0F; + /** + * + * + *
+   * Required. Total non-zero value associated with the transaction. This value
+   * may include shipping, tax, or other adjustments to the total value that you
+   * want to include.
+   * 
+ * + * optional float value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. Total non-zero value associated with the transaction. This value
+   * may include shipping, tax, or other adjustments to the total value that you
+   * want to include.
+   * 
+ * + * optional float value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + @java.lang.Override + public float getValue() { + return value_; + } + + public static final int CURRENCY_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object currency_ = ""; + /** + * + * + *
+   * Required. Currency code. Use three-character ISO-4217 code.
+   * 
+ * + * string currency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The currency. + */ + @java.lang.Override + public java.lang.String getCurrency() { + java.lang.Object ref = currency_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + currency_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Currency code. Use three-character ISO-4217 code.
+   * 
+ * + * string currency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for currency. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCurrencyBytes() { + java.lang.Object ref = currency_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currency_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRANSACTION_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object transactionId_ = ""; + /** + * + * + *
+   * The transaction ID with a length limit of 128 characters.
+   * 
+ * + * string transaction_id = 3; + * + * @return The transactionId. + */ + @java.lang.Override + public java.lang.String getTransactionId() { + java.lang.Object ref = transactionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + transactionId_ = s; + return s; + } + } + /** + * + * + *
+   * The transaction ID with a length limit of 128 characters.
+   * 
+ * + * string transaction_id = 3; + * + * @return The bytes for transactionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTransactionIdBytes() { + java.lang.Object ref = transactionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + transactionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TAX_FIELD_NUMBER = 4; + private float tax_ = 0F; + /** + * + * + *
+   * All the taxes associated with the transaction.
+   * 
+ * + * optional float tax = 4; + * + * @return Whether the tax field is set. + */ + @java.lang.Override + public boolean hasTax() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * All the taxes associated with the transaction.
+   * 
+ * + * optional float tax = 4; + * + * @return The tax. + */ + @java.lang.Override + public float getTax() { + return tax_; + } + + public static final int COST_FIELD_NUMBER = 5; + private float cost_ = 0F; + /** + * + * + *
+   * 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 =
+   * [value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] -
+   * [tax][google.cloud.discoveryengine.v1alpha.TransactionInfo.tax] -
+   * [cost][google.cloud.discoveryengine.v1alpha.TransactionInfo.cost]
+   * 
+ * + * optional float cost = 5; + * + * @return Whether the cost field is set. + */ + @java.lang.Override + public boolean hasCost() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * 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 =
+   * [value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] -
+   * [tax][google.cloud.discoveryengine.v1alpha.TransactionInfo.tax] -
+   * [cost][google.cloud.discoveryengine.v1alpha.TransactionInfo.cost]
+   * 
+ * + * optional float cost = 5; + * + * @return The cost. + */ + @java.lang.Override + public float getCost() { + return cost_; + } + + public static final int DISCOUNT_VALUE_FIELD_NUMBER = 6; + private float discountValue_ = 0F; + /** + * + * + *
+   * The total discount(s) value applied to this transaction.
+   * This figure should be excluded from
+   * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+   *
+   * For example, if a user paid
+   * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+   * amount, then nominal (pre-discount) value of the transaction is the sum of
+   * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+   * and
+   * [TransactionInfo.discount_value][google.cloud.discoveryengine.v1alpha.TransactionInfo.discount_value]
+   *
+   * This means that profit is calculated the same way, regardless of the
+   * discount value, and that
+   * [TransactionInfo.discount_value][google.cloud.discoveryengine.v1alpha.TransactionInfo.discount_value]
+   * can be larger than
+   * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]:
+   *
+   * * Profit =
+   * [value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] -
+   * [tax][google.cloud.discoveryengine.v1alpha.TransactionInfo.tax] -
+   * [cost][google.cloud.discoveryengine.v1alpha.TransactionInfo.cost]
+   * 
+ * + * optional float discount_value = 6; + * + * @return Whether the discountValue field is set. + */ + @java.lang.Override + public boolean hasDiscountValue() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * The total discount(s) value applied to this transaction.
+   * This figure should be excluded from
+   * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+   *
+   * For example, if a user paid
+   * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+   * amount, then nominal (pre-discount) value of the transaction is the sum of
+   * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+   * and
+   * [TransactionInfo.discount_value][google.cloud.discoveryengine.v1alpha.TransactionInfo.discount_value]
+   *
+   * This means that profit is calculated the same way, regardless of the
+   * discount value, and that
+   * [TransactionInfo.discount_value][google.cloud.discoveryengine.v1alpha.TransactionInfo.discount_value]
+   * can be larger than
+   * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]:
+   *
+   * * Profit =
+   * [value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] -
+   * [tax][google.cloud.discoveryengine.v1alpha.TransactionInfo.tax] -
+   * [cost][google.cloud.discoveryengine.v1alpha.TransactionInfo.cost]
+   * 
+ * + * optional float discount_value = 6; + * + * @return The discountValue. + */ + @java.lang.Override + public float getDiscountValue() { + return discountValue_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeFloat(1, value_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(currency_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, currency_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(transactionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, transactionId_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeFloat(4, tax_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeFloat(5, cost_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeFloat(6, discountValue_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, value_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(currency_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, currency_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(transactionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, transactionId_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, tax_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(5, cost_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(6, discountValue_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.TransactionInfo)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.TransactionInfo other = + (com.google.cloud.discoveryengine.v1alpha.TransactionInfo) obj; + + if (hasValue() != other.hasValue()) return false; + if (hasValue()) { + if (java.lang.Float.floatToIntBits(getValue()) + != java.lang.Float.floatToIntBits(other.getValue())) return false; + } + if (!getCurrency().equals(other.getCurrency())) return false; + if (!getTransactionId().equals(other.getTransactionId())) return false; + if (hasTax() != other.hasTax()) return false; + if (hasTax()) { + if (java.lang.Float.floatToIntBits(getTax()) + != java.lang.Float.floatToIntBits(other.getTax())) return false; + } + if (hasCost() != other.hasCost()) return false; + if (hasCost()) { + if (java.lang.Float.floatToIntBits(getCost()) + != java.lang.Float.floatToIntBits(other.getCost())) return false; + } + if (hasDiscountValue() != other.hasDiscountValue()) return false; + if (hasDiscountValue()) { + if (java.lang.Float.floatToIntBits(getDiscountValue()) + != java.lang.Float.floatToIntBits(other.getDiscountValue())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasValue()) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getValue()); + } + hash = (37 * hash) + CURRENCY_FIELD_NUMBER; + hash = (53 * hash) + getCurrency().hashCode(); + hash = (37 * hash) + TRANSACTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getTransactionId().hashCode(); + if (hasTax()) { + hash = (37 * hash) + TAX_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getTax()); + } + if (hasCost()) { + hash = (37 * hash) + COST_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getCost()); + } + if (hasDiscountValue()) { + hash = (37 * hash) + DISCOUNT_VALUE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getDiscountValue()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.TransactionInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.TransactionInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.TransactionInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.TransactionInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.TransactionInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.TransactionInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.TransactionInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.TransactionInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.TransactionInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.TransactionInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.TransactionInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.TransactionInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.TransactionInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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.discoveryengine.v1alpha.TransactionInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.TransactionInfo) + com.google.cloud.discoveryengine.v1alpha.TransactionInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_TransactionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_TransactionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.TransactionInfo.class, + com.google.cloud.discoveryengine.v1alpha.TransactionInfo.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.TransactionInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + value_ = 0F; + currency_ = ""; + transactionId_ = ""; + tax_ = 0F; + cost_ = 0F; + discountValue_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_TransactionInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.TransactionInfo getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.TransactionInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.TransactionInfo build() { + com.google.cloud.discoveryengine.v1alpha.TransactionInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.TransactionInfo buildPartial() { + com.google.cloud.discoveryengine.v1alpha.TransactionInfo result = + new com.google.cloud.discoveryengine.v1alpha.TransactionInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.TransactionInfo result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.value_ = value_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.currency_ = currency_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.transactionId_ = transactionId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.tax_ = tax_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.cost_ = cost_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.discountValue_ = discountValue_; + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.TransactionInfo) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.TransactionInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.TransactionInfo other) { + if (other == com.google.cloud.discoveryengine.v1alpha.TransactionInfo.getDefaultInstance()) + return this; + if (other.hasValue()) { + setValue(other.getValue()); + } + if (!other.getCurrency().isEmpty()) { + currency_ = other.currency_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getTransactionId().isEmpty()) { + transactionId_ = other.transactionId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasTax()) { + setTax(other.getTax()); + } + if (other.hasCost()) { + setCost(other.getCost()); + } + if (other.hasDiscountValue()) { + setDiscountValue(other.getDiscountValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: + { + value_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + case 18: + { + currency_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + transactionId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 37: + { + tax_ = input.readFloat(); + bitField0_ |= 0x00000008; + break; + } // case 37 + case 45: + { + cost_ = input.readFloat(); + bitField0_ |= 0x00000010; + break; + } // case 45 + case 53: + { + discountValue_ = input.readFloat(); + bitField0_ |= 0x00000020; + break; + } // case 53 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private float value_; + /** + * + * + *
+     * Required. Total non-zero value associated with the transaction. This value
+     * may include shipping, tax, or other adjustments to the total value that you
+     * want to include.
+     * 
+ * + * optional float value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Total non-zero value associated with the transaction. This value
+     * may include shipping, tax, or other adjustments to the total value that you
+     * want to include.
+     * 
+ * + * optional float value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + @java.lang.Override + public float getValue() { + return value_; + } + /** + * + * + *
+     * Required. Total non-zero value associated with the transaction. This value
+     * may include shipping, tax, or other adjustments to the total value that you
+     * want to include.
+     * 
+ * + * optional float value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(float value) { + + value_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Total non-zero value associated with the transaction. This value
+     * may include shipping, tax, or other adjustments to the total value that you
+     * want to include.
+     * 
+ * + * optional float value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000001); + value_ = 0F; + onChanged(); + return this; + } + + private java.lang.Object currency_ = ""; + /** + * + * + *
+     * Required. Currency code. Use three-character ISO-4217 code.
+     * 
+ * + * string currency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The currency. + */ + public java.lang.String getCurrency() { + java.lang.Object ref = currency_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + currency_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Currency code. Use three-character ISO-4217 code.
+     * 
+ * + * string currency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for currency. + */ + public com.google.protobuf.ByteString getCurrencyBytes() { + java.lang.Object ref = currency_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currency_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Currency code. Use three-character ISO-4217 code.
+     * 
+ * + * string currency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The currency to set. + * @return This builder for chaining. + */ + public Builder setCurrency(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + currency_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Currency code. Use three-character ISO-4217 code.
+     * 
+ * + * string currency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearCurrency() { + currency_ = getDefaultInstance().getCurrency(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Currency code. Use three-character ISO-4217 code.
+     * 
+ * + * string currency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for currency to set. + * @return This builder for chaining. + */ + public Builder setCurrencyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + currency_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object transactionId_ = ""; + /** + * + * + *
+     * The transaction ID with a length limit of 128 characters.
+     * 
+ * + * string transaction_id = 3; + * + * @return The transactionId. + */ + public java.lang.String getTransactionId() { + java.lang.Object ref = transactionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + transactionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The transaction ID with a length limit of 128 characters.
+     * 
+ * + * string transaction_id = 3; + * + * @return The bytes for transactionId. + */ + public com.google.protobuf.ByteString getTransactionIdBytes() { + java.lang.Object ref = transactionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + transactionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The transaction ID with a length limit of 128 characters.
+     * 
+ * + * string transaction_id = 3; + * + * @param value The transactionId to set. + * @return This builder for chaining. + */ + public Builder setTransactionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + transactionId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The transaction ID with a length limit of 128 characters.
+     * 
+ * + * string transaction_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearTransactionId() { + transactionId_ = getDefaultInstance().getTransactionId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The transaction ID with a length limit of 128 characters.
+     * 
+ * + * string transaction_id = 3; + * + * @param value The bytes for transactionId to set. + * @return This builder for chaining. + */ + public Builder setTransactionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + transactionId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private float tax_; + /** + * + * + *
+     * All the taxes associated with the transaction.
+     * 
+ * + * optional float tax = 4; + * + * @return Whether the tax field is set. + */ + @java.lang.Override + public boolean hasTax() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * All the taxes associated with the transaction.
+     * 
+ * + * optional float tax = 4; + * + * @return The tax. + */ + @java.lang.Override + public float getTax() { + return tax_; + } + /** + * + * + *
+     * All the taxes associated with the transaction.
+     * 
+ * + * optional float tax = 4; + * + * @param value The tax to set. + * @return This builder for chaining. + */ + public Builder setTax(float value) { + + tax_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * All the taxes associated with the transaction.
+     * 
+ * + * optional float tax = 4; + * + * @return This builder for chaining. + */ + public Builder clearTax() { + bitField0_ = (bitField0_ & ~0x00000008); + 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 =
+     * [value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] -
+     * [tax][google.cloud.discoveryengine.v1alpha.TransactionInfo.tax] -
+     * [cost][google.cloud.discoveryengine.v1alpha.TransactionInfo.cost]
+     * 
+ * + * optional float cost = 5; + * + * @return Whether the cost field is set. + */ + @java.lang.Override + public boolean hasCost() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * 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 =
+     * [value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] -
+     * [tax][google.cloud.discoveryengine.v1alpha.TransactionInfo.tax] -
+     * [cost][google.cloud.discoveryengine.v1alpha.TransactionInfo.cost]
+     * 
+ * + * optional float cost = 5; + * + * @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 =
+     * [value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] -
+     * [tax][google.cloud.discoveryengine.v1alpha.TransactionInfo.tax] -
+     * [cost][google.cloud.discoveryengine.v1alpha.TransactionInfo.cost]
+     * 
+ * + * optional float cost = 5; + * + * @param value The cost to set. + * @return This builder for chaining. + */ + public Builder setCost(float value) { + + cost_ = value; + bitField0_ |= 0x00000010; + 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 =
+     * [value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] -
+     * [tax][google.cloud.discoveryengine.v1alpha.TransactionInfo.tax] -
+     * [cost][google.cloud.discoveryengine.v1alpha.TransactionInfo.cost]
+     * 
+ * + * optional float cost = 5; + * + * @return This builder for chaining. + */ + public Builder clearCost() { + bitField0_ = (bitField0_ & ~0x00000010); + cost_ = 0F; + onChanged(); + return this; + } + + private float discountValue_; + /** + * + * + *
+     * The total discount(s) value applied to this transaction.
+     * This figure should be excluded from
+     * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+     *
+     * For example, if a user paid
+     * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+     * amount, then nominal (pre-discount) value of the transaction is the sum of
+     * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+     * and
+     * [TransactionInfo.discount_value][google.cloud.discoveryengine.v1alpha.TransactionInfo.discount_value]
+     *
+     * This means that profit is calculated the same way, regardless of the
+     * discount value, and that
+     * [TransactionInfo.discount_value][google.cloud.discoveryengine.v1alpha.TransactionInfo.discount_value]
+     * can be larger than
+     * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]:
+     *
+     * * Profit =
+     * [value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] -
+     * [tax][google.cloud.discoveryengine.v1alpha.TransactionInfo.tax] -
+     * [cost][google.cloud.discoveryengine.v1alpha.TransactionInfo.cost]
+     * 
+ * + * optional float discount_value = 6; + * + * @return Whether the discountValue field is set. + */ + @java.lang.Override + public boolean hasDiscountValue() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * The total discount(s) value applied to this transaction.
+     * This figure should be excluded from
+     * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+     *
+     * For example, if a user paid
+     * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+     * amount, then nominal (pre-discount) value of the transaction is the sum of
+     * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+     * and
+     * [TransactionInfo.discount_value][google.cloud.discoveryengine.v1alpha.TransactionInfo.discount_value]
+     *
+     * This means that profit is calculated the same way, regardless of the
+     * discount value, and that
+     * [TransactionInfo.discount_value][google.cloud.discoveryengine.v1alpha.TransactionInfo.discount_value]
+     * can be larger than
+     * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]:
+     *
+     * * Profit =
+     * [value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] -
+     * [tax][google.cloud.discoveryengine.v1alpha.TransactionInfo.tax] -
+     * [cost][google.cloud.discoveryengine.v1alpha.TransactionInfo.cost]
+     * 
+ * + * optional float discount_value = 6; + * + * @return The discountValue. + */ + @java.lang.Override + public float getDiscountValue() { + return discountValue_; + } + /** + * + * + *
+     * The total discount(s) value applied to this transaction.
+     * This figure should be excluded from
+     * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+     *
+     * For example, if a user paid
+     * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+     * amount, then nominal (pre-discount) value of the transaction is the sum of
+     * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+     * and
+     * [TransactionInfo.discount_value][google.cloud.discoveryengine.v1alpha.TransactionInfo.discount_value]
+     *
+     * This means that profit is calculated the same way, regardless of the
+     * discount value, and that
+     * [TransactionInfo.discount_value][google.cloud.discoveryengine.v1alpha.TransactionInfo.discount_value]
+     * can be larger than
+     * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]:
+     *
+     * * Profit =
+     * [value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] -
+     * [tax][google.cloud.discoveryengine.v1alpha.TransactionInfo.tax] -
+     * [cost][google.cloud.discoveryengine.v1alpha.TransactionInfo.cost]
+     * 
+ * + * optional float discount_value = 6; + * + * @param value The discountValue to set. + * @return This builder for chaining. + */ + public Builder setDiscountValue(float value) { + + discountValue_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The total discount(s) value applied to this transaction.
+     * This figure should be excluded from
+     * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+     *
+     * For example, if a user paid
+     * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+     * amount, then nominal (pre-discount) value of the transaction is the sum of
+     * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+     * and
+     * [TransactionInfo.discount_value][google.cloud.discoveryengine.v1alpha.TransactionInfo.discount_value]
+     *
+     * This means that profit is calculated the same way, regardless of the
+     * discount value, and that
+     * [TransactionInfo.discount_value][google.cloud.discoveryengine.v1alpha.TransactionInfo.discount_value]
+     * can be larger than
+     * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]:
+     *
+     * * Profit =
+     * [value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] -
+     * [tax][google.cloud.discoveryengine.v1alpha.TransactionInfo.tax] -
+     * [cost][google.cloud.discoveryengine.v1alpha.TransactionInfo.cost]
+     * 
+ * + * optional float discount_value = 6; + * + * @return This builder for chaining. + */ + public Builder clearDiscountValue() { + bitField0_ = (bitField0_ & ~0x00000020); + discountValue_ = 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.discoveryengine.v1alpha.TransactionInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.TransactionInfo) + private static final com.google.cloud.discoveryengine.v1alpha.TransactionInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.TransactionInfo(); + } + + public static com.google.cloud.discoveryengine.v1alpha.TransactionInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TransactionInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.TransactionInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/TransactionInfoOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/TransactionInfoOrBuilder.java new file mode 100644 index 000000000000..2c50bf8c9490 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/TransactionInfoOrBuilder.java @@ -0,0 +1,233 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/user_event.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface TransactionInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.TransactionInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Total non-zero value associated with the transaction. This value
+   * may include shipping, tax, or other adjustments to the total value that you
+   * want to include.
+   * 
+ * + * optional float value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the value field is set. + */ + boolean hasValue(); + /** + * + * + *
+   * Required. Total non-zero value associated with the transaction. This value
+   * may include shipping, tax, or other adjustments to the total value that you
+   * want to include.
+   * 
+ * + * optional float value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + float getValue(); + + /** + * + * + *
+   * Required. Currency code. Use three-character ISO-4217 code.
+   * 
+ * + * string currency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The currency. + */ + java.lang.String getCurrency(); + /** + * + * + *
+   * Required. Currency code. Use three-character ISO-4217 code.
+   * 
+ * + * string currency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for currency. + */ + com.google.protobuf.ByteString getCurrencyBytes(); + + /** + * + * + *
+   * The transaction ID with a length limit of 128 characters.
+   * 
+ * + * string transaction_id = 3; + * + * @return The transactionId. + */ + java.lang.String getTransactionId(); + /** + * + * + *
+   * The transaction ID with a length limit of 128 characters.
+   * 
+ * + * string transaction_id = 3; + * + * @return The bytes for transactionId. + */ + com.google.protobuf.ByteString getTransactionIdBytes(); + + /** + * + * + *
+   * All the taxes associated with the transaction.
+   * 
+ * + * optional float tax = 4; + * + * @return Whether the tax field is set. + */ + boolean hasTax(); + /** + * + * + *
+   * All the taxes associated with the transaction.
+   * 
+ * + * optional float tax = 4; + * + * @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 =
+   * [value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] -
+   * [tax][google.cloud.discoveryengine.v1alpha.TransactionInfo.tax] -
+   * [cost][google.cloud.discoveryengine.v1alpha.TransactionInfo.cost]
+   * 
+ * + * optional float cost = 5; + * + * @return Whether the cost field is set. + */ + boolean hasCost(); + /** + * + * + *
+   * 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 =
+   * [value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] -
+   * [tax][google.cloud.discoveryengine.v1alpha.TransactionInfo.tax] -
+   * [cost][google.cloud.discoveryengine.v1alpha.TransactionInfo.cost]
+   * 
+ * + * optional float cost = 5; + * + * @return The cost. + */ + float getCost(); + + /** + * + * + *
+   * The total discount(s) value applied to this transaction.
+   * This figure should be excluded from
+   * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+   *
+   * For example, if a user paid
+   * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+   * amount, then nominal (pre-discount) value of the transaction is the sum of
+   * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+   * and
+   * [TransactionInfo.discount_value][google.cloud.discoveryengine.v1alpha.TransactionInfo.discount_value]
+   *
+   * This means that profit is calculated the same way, regardless of the
+   * discount value, and that
+   * [TransactionInfo.discount_value][google.cloud.discoveryengine.v1alpha.TransactionInfo.discount_value]
+   * can be larger than
+   * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]:
+   *
+   * * Profit =
+   * [value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] -
+   * [tax][google.cloud.discoveryengine.v1alpha.TransactionInfo.tax] -
+   * [cost][google.cloud.discoveryengine.v1alpha.TransactionInfo.cost]
+   * 
+ * + * optional float discount_value = 6; + * + * @return Whether the discountValue field is set. + */ + boolean hasDiscountValue(); + /** + * + * + *
+   * The total discount(s) value applied to this transaction.
+   * This figure should be excluded from
+   * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+   *
+   * For example, if a user paid
+   * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+   * amount, then nominal (pre-discount) value of the transaction is the sum of
+   * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
+   * and
+   * [TransactionInfo.discount_value][google.cloud.discoveryengine.v1alpha.TransactionInfo.discount_value]
+   *
+   * This means that profit is calculated the same way, regardless of the
+   * discount value, and that
+   * [TransactionInfo.discount_value][google.cloud.discoveryengine.v1alpha.TransactionInfo.discount_value]
+   * can be larger than
+   * [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]:
+   *
+   * * Profit =
+   * [value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] -
+   * [tax][google.cloud.discoveryengine.v1alpha.TransactionInfo.tax] -
+   * [cost][google.cloud.discoveryengine.v1alpha.TransactionInfo.cost]
+   * 
+ * + * optional float discount_value = 6; + * + * @return The discountValue. + */ + float getDiscountValue(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateConversationRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateConversationRequest.java new file mode 100644 index 000000000000..61c563623d45 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateConversationRequest.java @@ -0,0 +1,1077 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request for UpdateConversation method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.UpdateConversationRequest} + */ +public final class UpdateConversationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.UpdateConversationRequest) + UpdateConversationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateConversationRequest.newBuilder() to construct. + private UpdateConversationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateConversationRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateConversationRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_UpdateConversationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_UpdateConversationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest.class, + com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest.Builder.class); + } + + public static final int CONVERSATION_FIELD_NUMBER = 1; + private com.google.cloud.discoveryengine.v1alpha.Conversation conversation_; + /** + * + * + *
+   * Required. The Conversation to update.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the conversation field is set. + */ + @java.lang.Override + public boolean hasConversation() { + return conversation_ != null; + } + /** + * + * + *
+   * Required. The Conversation to update.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversation. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Conversation getConversation() { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance() + : conversation_; + } + /** + * + * + *
+   * Required. The Conversation to update.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder getConversationOrBuilder() { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance() + : conversation_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+   * update. The following are NOT supported:
+   *
+   * * [conversation.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
+   * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+   * update. The following are NOT supported:
+   *
+   * * [conversation.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
+   * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+   * update. The following are NOT supported:
+   *
+   * * [conversation.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 updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (conversation_ != null) { + output.writeMessage(1, getConversation()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (conversation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getConversation()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest other = + (com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest) obj; + + if (hasConversation() != other.hasConversation()) return false; + if (hasConversation()) { + if (!getConversation().equals(other.getConversation())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasConversation()) { + hash = (37 * hash) + CONVERSATION_FIELD_NUMBER; + hash = (53 * hash) + getConversation().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 UpdateConversation method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.UpdateConversationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.UpdateConversationRequest) + com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_UpdateConversationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_UpdateConversationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest.class, + com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest.Builder.class); + } + + // Construct using + // com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + conversation_ = null; + if (conversationBuilder_ != null) { + conversationBuilder_.dispose(); + conversationBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_UpdateConversationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest build() { + com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest result = + new com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.conversation_ = + conversationBuilder_ == null ? conversation_ : conversationBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest) { + return mergeFrom( + (com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest + .getDefaultInstance()) return this; + if (other.hasConversation()) { + mergeConversation(other.getConversation()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getConversationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.discoveryengine.v1alpha.Conversation conversation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Conversation, + com.google.cloud.discoveryengine.v1alpha.Conversation.Builder, + com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder> + conversationBuilder_; + /** + * + * + *
+     * Required. The Conversation to update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the conversation field is set. + */ + public boolean hasConversation() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The Conversation to update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversation. + */ + public com.google.cloud.discoveryengine.v1alpha.Conversation getConversation() { + if (conversationBuilder_ == null) { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance() + : conversation_; + } else { + return conversationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The Conversation to update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConversation(com.google.cloud.discoveryengine.v1alpha.Conversation value) { + if (conversationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + conversation_ = value; + } else { + conversationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Conversation to update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConversation( + com.google.cloud.discoveryengine.v1alpha.Conversation.Builder builderForValue) { + if (conversationBuilder_ == null) { + conversation_ = builderForValue.build(); + } else { + conversationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Conversation to update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeConversation(com.google.cloud.discoveryengine.v1alpha.Conversation value) { + if (conversationBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && conversation_ != null + && conversation_ + != com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance()) { + getConversationBuilder().mergeFrom(value); + } else { + conversation_ = value; + } + } else { + conversationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Conversation to update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearConversation() { + bitField0_ = (bitField0_ & ~0x00000001); + conversation_ = null; + if (conversationBuilder_ != null) { + conversationBuilder_.dispose(); + conversationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Conversation to update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.Conversation.Builder getConversationBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getConversationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Conversation to update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder + getConversationOrBuilder() { + if (conversationBuilder_ != null) { + return conversationBuilder_.getMessageOrBuilder(); + } else { + return conversation_ == null + ? com.google.cloud.discoveryengine.v1alpha.Conversation.getDefaultInstance() + : conversation_; + } + } + /** + * + * + *
+     * Required. The Conversation to update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Conversation, + com.google.cloud.discoveryengine.v1alpha.Conversation.Builder, + com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder> + getConversationFieldBuilder() { + if (conversationBuilder_ == null) { + conversationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Conversation, + com.google.cloud.discoveryengine.v1alpha.Conversation.Builder, + com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder>( + getConversation(), getParentForChildren(), isClean()); + conversation_ = null; + } + return conversationBuilder_; + } + + 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
+     * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+     * update. The following are NOT supported:
+     *
+     * * [conversation.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 ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+     * update. The following are NOT supported:
+     *
+     * * [conversation.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
+     * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+     * update. The following are NOT supported:
+     *
+     * * [conversation.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; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+     * update. The following are NOT supported:
+     *
+     * * [conversation.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(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+     * update. The following are NOT supported:
+     *
+     * * [conversation.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 (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+     * update. The following are NOT supported:
+     *
+     * * [conversation.name][]
+     *
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+     * update. The following are NOT supported:
+     *
+     * * [conversation.name][]
+     *
+     * If not set or empty, all supported fields are updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates which fields in the provided
+     * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+     * update. The following are NOT supported:
+     *
+     * * [conversation.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
+     * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+     * update. The following are NOT supported:
+     *
+     * * [conversation.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.discoveryengine.v1alpha.UpdateConversationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.UpdateConversationRequest) + private static final com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateConversationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateConversationRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateConversationRequestOrBuilder.java new file mode 100644 index 000000000000..1b1f4301d9a3 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateConversationRequestOrBuilder.java @@ -0,0 +1,119 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/conversational_search_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface UpdateConversationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.UpdateConversationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Conversation to update.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the conversation field is set. + */ + boolean hasConversation(); + /** + * + * + *
+   * Required. The Conversation to update.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversation. + */ + com.google.cloud.discoveryengine.v1alpha.Conversation getConversation(); + /** + * + * + *
+   * Required. The Conversation to update.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Conversation conversation = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.discoveryengine.v1alpha.ConversationOrBuilder getConversationOrBuilder(); + + /** + * + * + *
+   * Indicates which fields in the provided
+   * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+   * update. The following are NOT supported:
+   *
+   * * [conversation.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
+   * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+   * update. The following are NOT supported:
+   *
+   * * [conversation.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
+   * [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to
+   * update. The following are NOT supported:
+   *
+   * * [conversation.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/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateDocumentRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateDocumentRequest.java new file mode 100644 index 000000000000..18f9ce7302b5 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateDocumentRequest.java @@ -0,0 +1,955 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/document_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request message for
+ * [DocumentService.UpdateDocument][google.cloud.discoveryengine.v1alpha.DocumentService.UpdateDocument]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest} + */ +public final class UpdateDocumentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest) + UpdateDocumentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateDocumentRequest.newBuilder() to construct. + private UpdateDocumentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateDocumentRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateDocumentRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_UpdateDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_UpdateDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.class, + com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.Builder.class); + } + + public static final int DOCUMENT_FIELD_NUMBER = 1; + private com.google.cloud.discoveryengine.v1alpha.Document document_; + /** + * + * + *
+   * Required. The document to update/create.
+   *
+   * If the caller does not have permission to update the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+   * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+   *
+   * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to update
+   * does not exist and
+   * [allow_missing][google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.allow_missing]
+   * is not set, a `NOT_FOUND` error is returned.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the document field is set. + */ + @java.lang.Override + public boolean hasDocument() { + return document_ != null; + } + /** + * + * + *
+   * Required. The document to update/create.
+   *
+   * If the caller does not have permission to update the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+   * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+   *
+   * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to update
+   * does not exist and
+   * [allow_missing][google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.allow_missing]
+   * is not set, a `NOT_FOUND` error is returned.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The document. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Document getDocument() { + return document_ == null + ? com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance() + : document_; + } + /** + * + * + *
+   * Required. The document to update/create.
+   *
+   * If the caller does not have permission to update the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+   * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+   *
+   * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to update
+   * does not exist and
+   * [allow_missing][google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.allow_missing]
+   * is not set, a `NOT_FOUND` error is returned.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder getDocumentOrBuilder() { + return document_ == null + ? com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance() + : document_; + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 2; + private boolean allowMissing_ = false; + /** + * + * + *
+   * If set to true, and the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document] is not found, a
+   * new [Document][google.cloud.discoveryengine.v1alpha.Document] will be
+   * created.
+   * 
+ * + * bool allow_missing = 2; + * + * @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 (document_ != null) { + output.writeMessage(1, getDocument()); + } + if (allowMissing_ != false) { + output.writeBool(2, allowMissing_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (document_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDocument()); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, allowMissing_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest other = + (com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest) obj; + + if (hasDocument() != other.hasDocument()) return false; + if (hasDocument()) { + if (!getDocument().equals(other.getDocument())) return false; + } + if (getAllowMissing() != other.getAllowMissing()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDocument()) { + hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; + hash = (53 * hash) + getDocument().hashCode(); + } + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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
+   * [DocumentService.UpdateDocument][google.cloud.discoveryengine.v1alpha.DocumentService.UpdateDocument]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest) + com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_UpdateDocumentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_UpdateDocumentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.class, + com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + document_ = null; + if (documentBuilder_ != null) { + documentBuilder_.dispose(); + documentBuilder_ = null; + } + allowMissing_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.DocumentServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_UpdateDocumentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest build() { + com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest result = + new com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.document_ = documentBuilder_ == null ? document_ : documentBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.allowMissing_ = allowMissing_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.getDefaultInstance()) + return this; + if (other.hasDocument()) { + mergeDocument(other.getDocument()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getDocumentFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + allowMissing_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.discoveryengine.v1alpha.Document document_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Document, + com.google.cloud.discoveryengine.v1alpha.Document.Builder, + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder> + documentBuilder_; + /** + * + * + *
+     * Required. The document to update/create.
+     *
+     * If the caller does not have permission to update the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to update
+     * does not exist and
+     * [allow_missing][google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.allow_missing]
+     * is not set, a `NOT_FOUND` error is returned.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the document field is set. + */ + public boolean hasDocument() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The document to update/create.
+     *
+     * If the caller does not have permission to update the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to update
+     * does not exist and
+     * [allow_missing][google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.allow_missing]
+     * is not set, a `NOT_FOUND` error is returned.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The document. + */ + public com.google.cloud.discoveryengine.v1alpha.Document getDocument() { + if (documentBuilder_ == null) { + return document_ == null + ? com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance() + : document_; + } else { + return documentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The document to update/create.
+     *
+     * If the caller does not have permission to update the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to update
+     * does not exist and
+     * [allow_missing][google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.allow_missing]
+     * is not set, a `NOT_FOUND` error is returned.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDocument(com.google.cloud.discoveryengine.v1alpha.Document value) { + if (documentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + document_ = value; + } else { + documentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The document to update/create.
+     *
+     * If the caller does not have permission to update the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to update
+     * does not exist and
+     * [allow_missing][google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.allow_missing]
+     * is not set, a `NOT_FOUND` error is returned.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDocument( + com.google.cloud.discoveryengine.v1alpha.Document.Builder builderForValue) { + if (documentBuilder_ == null) { + document_ = builderForValue.build(); + } else { + documentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The document to update/create.
+     *
+     * If the caller does not have permission to update the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to update
+     * does not exist and
+     * [allow_missing][google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.allow_missing]
+     * is not set, a `NOT_FOUND` error is returned.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDocument(com.google.cloud.discoveryengine.v1alpha.Document value) { + if (documentBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && document_ != null + && document_ + != com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance()) { + getDocumentBuilder().mergeFrom(value); + } else { + document_ = value; + } + } else { + documentBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The document to update/create.
+     *
+     * If the caller does not have permission to update the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to update
+     * does not exist and
+     * [allow_missing][google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.allow_missing]
+     * is not set, a `NOT_FOUND` error is returned.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDocument() { + bitField0_ = (bitField0_ & ~0x00000001); + document_ = null; + if (documentBuilder_ != null) { + documentBuilder_.dispose(); + documentBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The document to update/create.
+     *
+     * If the caller does not have permission to update the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to update
+     * does not exist and
+     * [allow_missing][google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.allow_missing]
+     * is not set, a `NOT_FOUND` error is returned.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.Document.Builder getDocumentBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getDocumentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The document to update/create.
+     *
+     * If the caller does not have permission to update the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to update
+     * does not exist and
+     * [allow_missing][google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.allow_missing]
+     * is not set, a `NOT_FOUND` error is returned.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder getDocumentOrBuilder() { + if (documentBuilder_ != null) { + return documentBuilder_.getMessageOrBuilder(); + } else { + return document_ == null + ? com.google.cloud.discoveryengine.v1alpha.Document.getDefaultInstance() + : document_; + } + } + /** + * + * + *
+     * Required. The document to update/create.
+     *
+     * If the caller does not have permission to update the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+     *
+     * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to update
+     * does not exist and
+     * [allow_missing][google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.allow_missing]
+     * is not set, a `NOT_FOUND` error is returned.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Document, + com.google.cloud.discoveryengine.v1alpha.Document.Builder, + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder> + getDocumentFieldBuilder() { + if (documentBuilder_ == null) { + documentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Document, + com.google.cloud.discoveryengine.v1alpha.Document.Builder, + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder>( + getDocument(), getParentForChildren(), isClean()); + document_ = null; + } + return documentBuilder_; + } + + private boolean allowMissing_; + /** + * + * + *
+     * If set to true, and the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document] is not found, a
+     * new [Document][google.cloud.discoveryengine.v1alpha.Document] will be
+     * created.
+     * 
+ * + * bool allow_missing = 2; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * If set to true, and the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document] is not found, a
+     * new [Document][google.cloud.discoveryengine.v1alpha.Document] will be
+     * created.
+     * 
+ * + * bool allow_missing = 2; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, and the
+     * [Document][google.cloud.discoveryengine.v1alpha.Document] is not found, a
+     * new [Document][google.cloud.discoveryengine.v1alpha.Document] will be
+     * created.
+     * 
+ * + * bool allow_missing = 2; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + bitField0_ = (bitField0_ & ~0x00000002); + 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.discoveryengine.v1alpha.UpdateDocumentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest) + private static final com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateDocumentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateDocumentRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateDocumentRequestOrBuilder.java new file mode 100644 index 000000000000..0b76b2ef561e --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateDocumentRequestOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/document_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface UpdateDocumentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The document to update/create.
+   *
+   * If the caller does not have permission to update the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+   * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+   *
+   * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to update
+   * does not exist and
+   * [allow_missing][google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.allow_missing]
+   * is not set, a `NOT_FOUND` error is returned.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the document field is set. + */ + boolean hasDocument(); + /** + * + * + *
+   * Required. The document to update/create.
+   *
+   * If the caller does not have permission to update the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+   * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+   *
+   * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to update
+   * does not exist and
+   * [allow_missing][google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.allow_missing]
+   * is not set, a `NOT_FOUND` error is returned.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The document. + */ + com.google.cloud.discoveryengine.v1alpha.Document getDocument(); + /** + * + * + *
+   * Required. The document to update/create.
+   *
+   * If the caller does not have permission to update the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of
+   * whether or not it exists, a `PERMISSION_DENIED` error is returned.
+   *
+   * If the [Document][google.cloud.discoveryengine.v1alpha.Document] to update
+   * does not exist and
+   * [allow_missing][google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.allow_missing]
+   * is not set, a `NOT_FOUND` error is returned.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.discoveryengine.v1alpha.DocumentOrBuilder getDocumentOrBuilder(); + + /** + * + * + *
+   * If set to true, and the
+   * [Document][google.cloud.discoveryengine.v1alpha.Document] is not found, a
+   * new [Document][google.cloud.discoveryengine.v1alpha.Document] will be
+   * created.
+   * 
+ * + * bool allow_missing = 2; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateSchemaMetadata.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateSchemaMetadata.java new file mode 100644 index 000000000000..1dbc9c97865d --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateSchemaMetadata.java @@ -0,0 +1,978 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Metadata for UpdateSchema LRO.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata} + */ +public final class UpdateSchemaMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata) + UpdateSchemaMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateSchemaMetadata.newBuilder() to construct. + private UpdateSchemaMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateSchemaMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateSchemaMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_UpdateSchemaMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_UpdateSchemaMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata.class, + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata.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 createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + 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 updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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()); + } + getUnknownFields().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 += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata other = + (com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata) 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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 UpdateSchema LRO.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata) + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_UpdateSchemaMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_UpdateSchemaMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata.class, + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_UpdateSchemaMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata build() { + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata buildPartial() { + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata result = + new com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + 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 ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * 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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + 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(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000001); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Operation create time.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000001; + 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 ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * 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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + 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(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + 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 (((bitField0_ & 0x00000002) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + 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() { + bitField0_ = (bitField0_ & ~0x00000002); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + 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() { + bitField0_ |= 0x00000002; + 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.discoveryengine.v1alpha.UpdateSchemaMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata) + private static final com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata(); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateSchemaMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateSchemaMetadataOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateSchemaMetadataOrBuilder.java new file mode 100644 index 000000000000..4f684652dbf7 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateSchemaMetadataOrBuilder.java @@ -0,0 +1,98 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface UpdateSchemaMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata) + 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/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateSchemaRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateSchemaRequest.java new file mode 100644 index 000000000000..51b7d71aed57 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateSchemaRequest.java @@ -0,0 +1,856 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request message for
+ * [SchemaService.UpdateSchema][google.cloud.discoveryengine.v1alpha.SchemaService.UpdateSchema]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest} + */ +public final class UpdateSchemaRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest) + UpdateSchemaRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateSchemaRequest.newBuilder() to construct. + private UpdateSchemaRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateSchemaRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateSchemaRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_UpdateSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_UpdateSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest.class, + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest.Builder.class); + } + + public static final int SCHEMA_FIELD_NUMBER = 1; + private com.google.cloud.discoveryengine.v1alpha.Schema schema_; + /** + * + * + *
+   * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+   * update.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the schema field is set. + */ + @java.lang.Override + public boolean hasSchema() { + return schema_ != null; + } + /** + * + * + *
+   * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+   * update.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The schema. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.Schema getSchema() { + return schema_ == null + ? com.google.cloud.discoveryengine.v1alpha.Schema.getDefaultInstance() + : schema_; + } + /** + * + * + *
+   * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+   * update.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SchemaOrBuilder getSchemaOrBuilder() { + return schema_ == null + ? com.google.cloud.discoveryengine.v1alpha.Schema.getDefaultInstance() + : schema_; + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 3; + private boolean allowMissing_ = false; + /** + * + * + *
+   * If set to true, and the
+   * [Schema][google.cloud.discoveryengine.v1alpha.Schema] is not found, a new
+   * [Schema][google.cloud.discoveryengine.v1alpha.Schema] 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 (schema_ != null) { + output.writeMessage(1, getSchema()); + } + if (allowMissing_ != false) { + output.writeBool(3, allowMissing_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (schema_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSchema()); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, allowMissing_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest other = + (com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest) obj; + + if (hasSchema() != other.hasSchema()) return false; + if (hasSchema()) { + if (!getSchema().equals(other.getSchema())) return false; + } + if (getAllowMissing() != other.getAllowMissing()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSchema()) { + hash = (37 * hash) + SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getSchema().hashCode(); + } + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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
+   * [SchemaService.UpdateSchema][google.cloud.discoveryengine.v1alpha.SchemaService.UpdateSchema]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest) + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_UpdateSchemaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_UpdateSchemaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest.class, + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + schema_ = null; + if (schemaBuilder_ != null) { + schemaBuilder_.dispose(); + schemaBuilder_ = null; + } + allowMissing_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.SchemaServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_UpdateSchemaRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest build() { + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest result = + new com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.schema_ = schemaBuilder_ == null ? schema_ : schemaBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.allowMissing_ = allowMissing_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest.getDefaultInstance()) + return this; + if (other.hasSchema()) { + mergeSchema(other.getSchema()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getSchemaFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 24: + { + allowMissing_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.discoveryengine.v1alpha.Schema schema_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Schema, + com.google.cloud.discoveryengine.v1alpha.Schema.Builder, + com.google.cloud.discoveryengine.v1alpha.SchemaOrBuilder> + schemaBuilder_; + /** + * + * + *
+     * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+     * update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the schema field is set. + */ + public boolean hasSchema() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+     * update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The schema. + */ + public com.google.cloud.discoveryengine.v1alpha.Schema getSchema() { + if (schemaBuilder_ == null) { + return schema_ == null + ? com.google.cloud.discoveryengine.v1alpha.Schema.getDefaultInstance() + : schema_; + } else { + return schemaBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+     * update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSchema(com.google.cloud.discoveryengine.v1alpha.Schema value) { + if (schemaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schema_ = value; + } else { + schemaBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+     * update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSchema( + com.google.cloud.discoveryengine.v1alpha.Schema.Builder builderForValue) { + if (schemaBuilder_ == null) { + schema_ = builderForValue.build(); + } else { + schemaBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+     * update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSchema(com.google.cloud.discoveryengine.v1alpha.Schema value) { + if (schemaBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && schema_ != null + && schema_ != com.google.cloud.discoveryengine.v1alpha.Schema.getDefaultInstance()) { + getSchemaBuilder().mergeFrom(value); + } else { + schema_ = value; + } + } else { + schemaBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+     * update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSchema() { + bitField0_ = (bitField0_ & ~0x00000001); + schema_ = null; + if (schemaBuilder_ != null) { + schemaBuilder_.dispose(); + schemaBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+     * update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.Schema.Builder getSchemaBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getSchemaFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+     * update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.SchemaOrBuilder getSchemaOrBuilder() { + if (schemaBuilder_ != null) { + return schemaBuilder_.getMessageOrBuilder(); + } else { + return schema_ == null + ? com.google.cloud.discoveryengine.v1alpha.Schema.getDefaultInstance() + : schema_; + } + } + /** + * + * + *
+     * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+     * update.
+     * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Schema, + com.google.cloud.discoveryengine.v1alpha.Schema.Builder, + com.google.cloud.discoveryengine.v1alpha.SchemaOrBuilder> + getSchemaFieldBuilder() { + if (schemaBuilder_ == null) { + schemaBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.Schema, + com.google.cloud.discoveryengine.v1alpha.Schema.Builder, + com.google.cloud.discoveryengine.v1alpha.SchemaOrBuilder>( + getSchema(), getParentForChildren(), isClean()); + schema_ = null; + } + return schemaBuilder_; + } + + private boolean allowMissing_; + /** + * + * + *
+     * If set to true, and the
+     * [Schema][google.cloud.discoveryengine.v1alpha.Schema] is not found, a new
+     * [Schema][google.cloud.discoveryengine.v1alpha.Schema] 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
+     * [Schema][google.cloud.discoveryengine.v1alpha.Schema] is not found, a new
+     * [Schema][google.cloud.discoveryengine.v1alpha.Schema] 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, and the
+     * [Schema][google.cloud.discoveryengine.v1alpha.Schema] is not found, a new
+     * [Schema][google.cloud.discoveryengine.v1alpha.Schema] will be created. In
+     * this situation, `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 3; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + bitField0_ = (bitField0_ & ~0x00000002); + 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.discoveryengine.v1alpha.UpdateSchemaRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest) + private static final com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateSchemaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateSchemaRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateSchemaRequestOrBuilder.java new file mode 100644 index 000000000000..4e620be6c5fd --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UpdateSchemaRequestOrBuilder.java @@ -0,0 +1,85 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/schema_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface UpdateSchemaRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+   * update.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the schema field is set. + */ + boolean hasSchema(); + /** + * + * + *
+   * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+   * update.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The schema. + */ + com.google.cloud.discoveryengine.v1alpha.Schema getSchema(); + /** + * + * + *
+   * Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to
+   * update.
+   * 
+ * + * + * .google.cloud.discoveryengine.v1alpha.Schema schema = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.discoveryengine.v1alpha.SchemaOrBuilder getSchemaOrBuilder(); + + /** + * + * + *
+   * If set to true, and the
+   * [Schema][google.cloud.discoveryengine.v1alpha.Schema] is not found, a new
+   * [Schema][google.cloud.discoveryengine.v1alpha.Schema] will be created. In
+   * this situation, `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 3; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEvent.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEvent.java new file mode 100644 index 000000000000..5cf51fb9cb7d --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEvent.java @@ -0,0 +1,6448 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/user_event.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * UserEvent captures all metadata information Discovery Engine API needs to
+ * know about how end users interact with customers' website.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.UserEvent} + */ +public final class UserEvent extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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_ = ""; + userPseudoId_ = ""; + sessionId_ = ""; + attributionToken_ = ""; + filter_ = ""; + documents_ = java.util.Collections.emptyList(); + tagIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + promotionIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UserEvent(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_UserEvent_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 17: + 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.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_UserEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.UserEvent.class, + com.google.cloud.discoveryengine.v1alpha.UserEvent.Builder.class); + } + + public static final int EVENT_TYPE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object eventType_ = ""; + /** + * + * + *
+   * Required. User event type. Allowed values are:
+   *
+   * Generic values:
+   *
+   * * `search`: Search for Documents.
+   * * `view-item`: Detailed page view of a Document.
+   * * `view-item-list`: View of a panel or ordered list of Documents.
+   * * `view-home-page`: View of the home page.
+   * * `view-category-page`: View of a category page, e.g. Home > Men > Jeans
+   *
+   * Retail-related values:
+   *
+   * * `add-to-cart`: Add an item(s) to cart, e.g. in Retail online shopping
+   * * `purchase`: Purchase an item(s)
+   *
+   * Media-related values:
+   *
+   * * `media-play`: Start/resume watching a video, playing a song, etc.
+   * * `media-complete`: Finished or stopped midway through a video, song, etc.
+   * 
+ * + * 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:
+   *
+   * Generic values:
+   *
+   * * `search`: Search for Documents.
+   * * `view-item`: Detailed page view of a Document.
+   * * `view-item-list`: View of a panel or ordered list of Documents.
+   * * `view-home-page`: View of the home page.
+   * * `view-category-page`: View of a category page, e.g. Home > Men > Jeans
+   *
+   * Retail-related values:
+   *
+   * * `add-to-cart`: Add an item(s) to cart, e.g. in Retail online shopping
+   * * `purchase`: Purchase an item(s)
+   *
+   * Media-related values:
+   *
+   * * `media-play`: Start/resume watching a video, playing a song, etc.
+   * * `media-complete`: Finished or stopped midway through a video, song, etc.
+   * 
+ * + * 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 USER_PSEUDO_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object userPseudoId_ = ""; + /** + * + * + *
+   * 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.
+   *
+   * Do not set the field to the same fixed ID for different users. This mixes
+   * the event history of those users together, which results in degraded model
+   * quality.
+   *
+   * 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
+   * Analytics [Client
+   * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+   * for this field.
+   * 
+ * + * string user_pseudo_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The userPseudoId. + */ + @java.lang.Override + public java.lang.String getUserPseudoId() { + java.lang.Object ref = userPseudoId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userPseudoId_ = 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.
+   *
+   * Do not set the field to the same fixed ID for different users. This mixes
+   * the event history of those users together, which results in degraded model
+   * quality.
+   *
+   * 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
+   * Analytics [Client
+   * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+   * for this field.
+   * 
+ * + * string user_pseudo_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for userPseudoId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserPseudoIdBytes() { + java.lang.Object ref = userPseudoId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userPseudoId_ = 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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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 eventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTime_; + } + + public static final int USER_INFO_FIELD_NUMBER = 4; + private com.google.cloud.discoveryengine.v1alpha.UserInfo userInfo_; + /** + * + * + *
+   * Information about the end user.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 4; + * + * @return Whether the userInfo field is set. + */ + @java.lang.Override + public boolean hasUserInfo() { + return userInfo_ != null; + } + /** + * + * + *
+   * Information about the end user.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 4; + * + * @return The userInfo. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UserInfo getUserInfo() { + return userInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.UserInfo.getDefaultInstance() + : userInfo_; + } + /** + * + * + *
+   * Information about the end user.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 4; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UserInfoOrBuilder getUserInfoOrBuilder() { + return userInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.UserInfo.getDefaultInstance() + : userInfo_; + } + + public static final int DIRECT_USER_REQUEST_FIELD_NUMBER = 5; + private boolean directUserRequest_ = false; + /** + * + * + *
+   * Should set to true if the request is made directly from the end user, in
+   * which case the
+   * [UserEvent.user_info.user_agent][google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEventService.CollectUserEvent].
+   * 
+ * + * bool direct_user_request = 5; + * + * @return The directUserRequest. + */ + @java.lang.Override + public boolean getDirectUserRequest() { + return directUserRequest_; + } + + public static final int SESSION_ID_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + 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 session_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
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * as prefix.
+   * 
+ * + * string session_id = 6; + * + * @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 session_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
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * as prefix.
+   * 
+ * + * string session_id = 6; + * + * @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 PAGE_INFO_FIELD_NUMBER = 7; + private com.google.cloud.discoveryengine.v1alpha.PageInfo pageInfo_; + /** + * + * + *
+   * Page metadata such as categories and other critical information for certain
+   * event types such as `view-category-page`.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.PageInfo page_info = 7; + * + * @return Whether the pageInfo field is set. + */ + @java.lang.Override + public boolean hasPageInfo() { + return pageInfo_ != null; + } + /** + * + * + *
+   * Page metadata such as categories and other critical information for certain
+   * event types such as `view-category-page`.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.PageInfo page_info = 7; + * + * @return The pageInfo. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PageInfo getPageInfo() { + return pageInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.PageInfo.getDefaultInstance() + : pageInfo_; + } + /** + * + * + *
+   * Page metadata such as categories and other critical information for certain
+   * event types such as `view-category-page`.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.PageInfo page_info = 7; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PageInfoOrBuilder getPageInfoOrBuilder() { + return pageInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.PageInfo.getDefaultInstance() + : pageInfo_; + } + + public static final int ATTRIBUTION_TOKEN_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object attributionToken_ = ""; + /** + * + * + *
+   * Token to attribute an API response to user action(s) to trigger the event.
+   *
+   * Highly recommended for user events that are the result of
+   * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+   * This field enables accurate attribution of recommendation model
+   * performance.
+   *
+   * The value must be one of:
+   *
+   * * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token] for events that are the result of
+   * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+   * * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1alpha.SearchResponse.attribution_token] for events that are the result of
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+   *
+   * This token enables us to accurately attribute page view or conversion
+   * completion 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
+   * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token]
+   * as a URL parameter to product K's page. When recording events on product
+   * K's page, log the
+   * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token]
+   * to this field.
+   * 
+ * + * string attribution_token = 8; + * + * @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; + } + } + /** + * + * + *
+   * Token to attribute an API response to user action(s) to trigger the event.
+   *
+   * Highly recommended for user events that are the result of
+   * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+   * This field enables accurate attribution of recommendation model
+   * performance.
+   *
+   * The value must be one of:
+   *
+   * * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token] for events that are the result of
+   * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+   * * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1alpha.SearchResponse.attribution_token] for events that are the result of
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+   *
+   * This token enables us to accurately attribute page view or conversion
+   * completion 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
+   * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token]
+   * as a URL parameter to product K's page. When recording events on product
+   * K's page, log the
+   * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token]
+   * to this field.
+   * 
+ * + * string attribution_token = 8; + * + * @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 FILTER_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + 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 documents being filtered.
+   *
+   * One example is for `search` events, the associated
+   * [SearchRequest][google.cloud.discoveryengine.v1alpha.SearchRequest] may
+   * contain a filter expression in
+   * [SearchRequest.filter][google.cloud.discoveryengine.v1alpha.SearchRequest.filter]
+   * conforming to https://google.aip.dev/160#filtering.
+   *
+   * Similarly, for `view-item-list` events that are generated from a
+   * [RecommendationService.RecommendRequest][], this field may be populated
+   * directly from [RecommendationService.RecommendRequest.filter][] conforming
+   * to https://google.aip.dev/160#filtering.
+   *
+   * 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 = 9; + * + * @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 documents being filtered.
+   *
+   * One example is for `search` events, the associated
+   * [SearchRequest][google.cloud.discoveryengine.v1alpha.SearchRequest] may
+   * contain a filter expression in
+   * [SearchRequest.filter][google.cloud.discoveryengine.v1alpha.SearchRequest.filter]
+   * conforming to https://google.aip.dev/160#filtering.
+   *
+   * Similarly, for `view-item-list` events that are generated from a
+   * [RecommendationService.RecommendRequest][], this field may be populated
+   * directly from [RecommendationService.RecommendRequest.filter][] conforming
+   * to https://google.aip.dev/160#filtering.
+   *
+   * 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 = 9; + * + * @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 DOCUMENTS_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private java.util.List documents_; + /** + * + * + *
+   * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+   * associated with this user event.
+   *
+   * This field is optional except for the following event types:
+   *
+   * * `view-item`
+   * * `add-to-cart`
+   * * `purchase`
+   * * `media-play`
+   * * `media-complete`
+   *
+   * In a `search` event, this field represents the documents 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
+   * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+   * is desired.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + @java.lang.Override + public java.util.List getDocumentsList() { + return documents_; + } + /** + * + * + *
+   * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+   * associated with this user event.
+   *
+   * This field is optional except for the following event types:
+   *
+   * * `view-item`
+   * * `add-to-cart`
+   * * `purchase`
+   * * `media-play`
+   * * `media-complete`
+   *
+   * In a `search` event, this field represents the documents 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
+   * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+   * is desired.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + @java.lang.Override + public java.util.List + getDocumentsOrBuilderList() { + return documents_; + } + /** + * + * + *
+   * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+   * associated with this user event.
+   *
+   * This field is optional except for the following event types:
+   *
+   * * `view-item`
+   * * `add-to-cart`
+   * * `purchase`
+   * * `media-play`
+   * * `media-complete`
+   *
+   * In a `search` event, this field represents the documents 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
+   * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+   * is desired.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + @java.lang.Override + public int getDocumentsCount() { + return documents_.size(); + } + /** + * + * + *
+   * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+   * associated with this user event.
+   *
+   * This field is optional except for the following event types:
+   *
+   * * `view-item`
+   * * `add-to-cart`
+   * * `purchase`
+   * * `media-play`
+   * * `media-complete`
+   *
+   * In a `search` event, this field represents the documents 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
+   * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+   * is desired.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DocumentInfo getDocuments(int index) { + return documents_.get(index); + } + /** + * + * + *
+   * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+   * associated with this user event.
+   *
+   * This field is optional except for the following event types:
+   *
+   * * `view-item`
+   * * `add-to-cart`
+   * * `purchase`
+   * * `media-play`
+   * * `media-complete`
+   *
+   * In a `search` event, this field represents the documents 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
+   * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+   * is desired.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.DocumentInfoOrBuilder getDocumentsOrBuilder( + int index) { + return documents_.get(index); + } + + public static final int PANEL_FIELD_NUMBER = 11; + private com.google.cloud.discoveryengine.v1alpha.PanelInfo panel_; + /** + * + * + *
+   * Panel metadata associated with this user event.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.PanelInfo panel = 11; + * + * @return Whether the panel field is set. + */ + @java.lang.Override + public boolean hasPanel() { + return panel_ != null; + } + /** + * + * + *
+   * Panel metadata associated with this user event.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.PanelInfo panel = 11; + * + * @return The panel. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PanelInfo getPanel() { + return panel_ == null + ? com.google.cloud.discoveryengine.v1alpha.PanelInfo.getDefaultInstance() + : panel_; + } + /** + * + * + *
+   * Panel metadata associated with this user event.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.PanelInfo panel = 11; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.PanelInfoOrBuilder getPanelOrBuilder() { + return panel_ == null + ? com.google.cloud.discoveryengine.v1alpha.PanelInfo.getDefaultInstance() + : panel_; + } + + public static final int SEARCH_INFO_FIELD_NUMBER = 12; + private com.google.cloud.discoveryengine.v1alpha.SearchInfo searchInfo_; + /** + * + * + *
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+   * details related to the event.
+   *
+   * This field should be set for `search` event.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchInfo search_info = 12; + * + * @return Whether the searchInfo field is set. + */ + @java.lang.Override + public boolean hasSearchInfo() { + return searchInfo_ != null; + } + /** + * + * + *
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+   * details related to the event.
+   *
+   * This field should be set for `search` event.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchInfo search_info = 12; + * + * @return The searchInfo. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchInfo getSearchInfo() { + return searchInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchInfo.getDefaultInstance() + : searchInfo_; + } + /** + * + * + *
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+   * details related to the event.
+   *
+   * This field should be set for `search` event.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchInfo search_info = 12; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.SearchInfoOrBuilder getSearchInfoOrBuilder() { + return searchInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchInfo.getDefaultInstance() + : searchInfo_; + } + + public static final int COMPLETION_INFO_FIELD_NUMBER = 13; + private com.google.cloud.discoveryengine.v1alpha.CompletionInfo completionInfo_; + /** + * + * + *
+   * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery]
+   * 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.discoveryengine.v1alpha.CompletionInfo completion_info = 13; + * + * @return Whether the completionInfo field is set. + */ + @java.lang.Override + public boolean hasCompletionInfo() { + return completionInfo_ != null; + } + /** + * + * + *
+   * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery]
+   * 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.discoveryengine.v1alpha.CompletionInfo completion_info = 13; + * + * @return The completionInfo. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CompletionInfo getCompletionInfo() { + return completionInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.CompletionInfo.getDefaultInstance() + : completionInfo_; + } + /** + * + * + *
+   * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery]
+   * 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.discoveryengine.v1alpha.CompletionInfo completion_info = 13; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.CompletionInfoOrBuilder + getCompletionInfoOrBuilder() { + return completionInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.CompletionInfo.getDefaultInstance() + : completionInfo_; + } + + public static final int TRANSACTION_INFO_FIELD_NUMBER = 14; + private com.google.cloud.discoveryengine.v1alpha.TransactionInfo transactionInfo_; + /** + * + * + *
+   * The transaction metadata (if any) associated with this user event.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.TransactionInfo transaction_info = 14; + * + * @return Whether the transactionInfo field is set. + */ + @java.lang.Override + public boolean hasTransactionInfo() { + return transactionInfo_ != null; + } + /** + * + * + *
+   * The transaction metadata (if any) associated with this user event.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.TransactionInfo transaction_info = 14; + * + * @return The transactionInfo. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.TransactionInfo getTransactionInfo() { + return transactionInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.TransactionInfo.getDefaultInstance() + : transactionInfo_; + } + /** + * + * + *
+   * The transaction metadata (if any) associated with this user event.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.TransactionInfo transaction_info = 14; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.TransactionInfoOrBuilder + getTransactionInfoOrBuilder() { + return transactionInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.TransactionInfo.getDefaultInstance() + : transactionInfo_; + } + + public static final int TAG_IDS_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList tagIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * 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 on the customer end.
+   * 
+ * + * repeated string tag_ids = 15; + * + * @return A list containing the tagIds. + */ + public com.google.protobuf.ProtocolStringList getTagIdsList() { + return tagIds_; + } + /** + * + * + *
+   * 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 on the customer end.
+   * 
+ * + * repeated string tag_ids = 15; + * + * @return The count of tagIds. + */ + public int getTagIdsCount() { + return tagIds_.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 on the customer end.
+   * 
+ * + * repeated string tag_ids = 15; + * + * @param index The index of the element to return. + * @return The tagIds at the given index. + */ + public java.lang.String getTagIds(int index) { + return tagIds_.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 on the customer end.
+   * 
+ * + * repeated string tag_ids = 15; + * + * @param index The index of the value to return. + * @return The bytes of the tagIds at the given index. + */ + public com.google.protobuf.ByteString getTagIdsBytes(int index) { + return tagIds_.getByteString(index); + } + + public static final int PROMOTION_IDS_FIELD_NUMBER = 16; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList promotionIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * The promotion IDs if this is an event associated with promotions.
+   * Currently, this field is restricted to at most one ID.
+   * 
+ * + * repeated string promotion_ids = 16; + * + * @return A list containing the promotionIds. + */ + public com.google.protobuf.ProtocolStringList getPromotionIdsList() { + return promotionIds_; + } + /** + * + * + *
+   * The promotion IDs if this is an event associated with promotions.
+   * Currently, this field is restricted to at most one ID.
+   * 
+ * + * repeated string promotion_ids = 16; + * + * @return The count of promotionIds. + */ + public int getPromotionIdsCount() { + return promotionIds_.size(); + } + /** + * + * + *
+   * The promotion IDs if this is an event associated with promotions.
+   * Currently, this field is restricted to at most one ID.
+   * 
+ * + * repeated string promotion_ids = 16; + * + * @param index The index of the element to return. + * @return The promotionIds at the given index. + */ + public java.lang.String getPromotionIds(int index) { + return promotionIds_.get(index); + } + /** + * + * + *
+   * The promotion IDs if this is an event associated with promotions.
+   * Currently, this field is restricted to at most one ID.
+   * 
+ * + * repeated string promotion_ids = 16; + * + * @param index The index of the value to return. + * @return The bytes of the promotionIds at the given index. + */ + public com.google.protobuf.ByteString getPromotionIdsBytes(int index) { + return promotionIds_.getByteString(index); + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 17; + + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.discoveryengine.v1alpha.CustomAttribute> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_UserEvent_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.discoveryengine.v1alpha.CustomAttribute + .getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.discoveryengine.v1alpha.CustomAttribute> + attributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.discoveryengine.v1alpha.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.
+   * These attributes must NOT contain data that needs to be parsed or processed
+   * further, e.g. JSON or other encodings.
+   *
+   * 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 Discovery Engine 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.discoveryengine.v1alpha.CustomAttribute> attributes = 17; + * + */ + @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.
+   * These attributes must NOT contain data that needs to be parsed or processed
+   * further, e.g. JSON or other encodings.
+   *
+   * 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 Discovery Engine 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.discoveryengine.v1alpha.CustomAttribute> attributes = 17; + * + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * These attributes must NOT contain data that needs to be parsed or processed
+   * further, e.g. JSON or other encodings.
+   *
+   * 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 Discovery Engine 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.discoveryengine.v1alpha.CustomAttribute> attributes = 17; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.discoveryengine.v1alpha.CustomAttribute + getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.discoveryengine.v1alpha.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.
+   * These attributes must NOT contain data that needs to be parsed or processed
+   * further, e.g. JSON or other encodings.
+   *
+   * 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 Discovery Engine 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.discoveryengine.v1alpha.CustomAttribute> attributes = 17; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.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 MEDIA_INFO_FIELD_NUMBER = 18; + private com.google.cloud.discoveryengine.v1alpha.MediaInfo mediaInfo_; + /** + * + * + *
+   * Media-specific info.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.MediaInfo media_info = 18; + * + * @return Whether the mediaInfo field is set. + */ + @java.lang.Override + public boolean hasMediaInfo() { + return mediaInfo_ != null; + } + /** + * + * + *
+   * Media-specific info.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.MediaInfo media_info = 18; + * + * @return The mediaInfo. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.MediaInfo getMediaInfo() { + return mediaInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.MediaInfo.getDefaultInstance() + : mediaInfo_; + } + /** + * + * + *
+   * Media-specific info.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.MediaInfo media_info = 18; + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.MediaInfoOrBuilder getMediaInfoOrBuilder() { + return mediaInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.MediaInfo.getDefaultInstance() + : mediaInfo_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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(userPseudoId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, userPseudoId_); + } + if (eventTime_ != null) { + output.writeMessage(3, getEventTime()); + } + if (userInfo_ != null) { + output.writeMessage(4, getUserInfo()); + } + if (directUserRequest_ != false) { + output.writeBool(5, directUserRequest_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sessionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, sessionId_); + } + if (pageInfo_ != null) { + output.writeMessage(7, getPageInfo()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributionToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, attributionToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, filter_); + } + for (int i = 0; i < documents_.size(); i++) { + output.writeMessage(10, documents_.get(i)); + } + if (panel_ != null) { + output.writeMessage(11, getPanel()); + } + if (searchInfo_ != null) { + output.writeMessage(12, getSearchInfo()); + } + if (completionInfo_ != null) { + output.writeMessage(13, getCompletionInfo()); + } + if (transactionInfo_ != null) { + output.writeMessage(14, getTransactionInfo()); + } + for (int i = 0; i < tagIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, tagIds_.getRaw(i)); + } + for (int i = 0; i < promotionIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 16, promotionIds_.getRaw(i)); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 17); + if (mediaInfo_ != null) { + output.writeMessage(18, getMediaInfo()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(eventType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, eventType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userPseudoId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, userPseudoId_); + } + if (eventTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEventTime()); + } + if (userInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUserInfo()); + } + if (directUserRequest_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, directUserRequest_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sessionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, sessionId_); + } + if (pageInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getPageInfo()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributionToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, attributionToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, filter_); + } + for (int i = 0; i < documents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, documents_.get(i)); + } + if (panel_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getPanel()); + } + if (searchInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getSearchInfo()); + } + if (completionInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getCompletionInfo()); + } + if (transactionInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getTransactionInfo()); + } + { + int dataSize = 0; + for (int i = 0; i < tagIds_.size(); i++) { + dataSize += computeStringSizeNoTag(tagIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getTagIdsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < promotionIds_.size(); i++) { + dataSize += computeStringSizeNoTag(promotionIds_.getRaw(i)); + } + size += dataSize; + size += 2 * getPromotionIdsList().size(); + } + for (java.util.Map.Entry< + java.lang.String, com.google.cloud.discoveryengine.v1alpha.CustomAttribute> + entry : internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.discoveryengine.v1alpha.CustomAttribute> + attributes__ = + AttributesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, attributes__); + } + if (mediaInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, getMediaInfo()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.UserEvent)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.UserEvent other = + (com.google.cloud.discoveryengine.v1alpha.UserEvent) obj; + + if (!getEventType().equals(other.getEventType())) return false; + if (!getUserPseudoId().equals(other.getUserPseudoId())) return false; + if (hasEventTime() != other.hasEventTime()) return false; + if (hasEventTime()) { + if (!getEventTime().equals(other.getEventTime())) return false; + } + if (hasUserInfo() != other.hasUserInfo()) return false; + if (hasUserInfo()) { + if (!getUserInfo().equals(other.getUserInfo())) return false; + } + if (getDirectUserRequest() != other.getDirectUserRequest()) return false; + if (!getSessionId().equals(other.getSessionId())) return false; + if (hasPageInfo() != other.hasPageInfo()) return false; + if (hasPageInfo()) { + if (!getPageInfo().equals(other.getPageInfo())) return false; + } + if (!getAttributionToken().equals(other.getAttributionToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getDocumentsList().equals(other.getDocumentsList())) return false; + if (hasPanel() != other.hasPanel()) return false; + if (hasPanel()) { + if (!getPanel().equals(other.getPanel())) return false; + } + if (hasSearchInfo() != other.hasSearchInfo()) return false; + if (hasSearchInfo()) { + if (!getSearchInfo().equals(other.getSearchInfo())) return false; + } + if (hasCompletionInfo() != other.hasCompletionInfo()) return false; + if (hasCompletionInfo()) { + if (!getCompletionInfo().equals(other.getCompletionInfo())) return false; + } + if (hasTransactionInfo() != other.hasTransactionInfo()) return false; + if (hasTransactionInfo()) { + if (!getTransactionInfo().equals(other.getTransactionInfo())) return false; + } + if (!getTagIdsList().equals(other.getTagIdsList())) return false; + if (!getPromotionIdsList().equals(other.getPromotionIdsList())) return false; + if (!internalGetAttributes().equals(other.internalGetAttributes())) return false; + if (hasMediaInfo() != other.hasMediaInfo()) return false; + if (hasMediaInfo()) { + if (!getMediaInfo().equals(other.getMediaInfo())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + EVENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getEventType().hashCode(); + hash = (37 * hash) + USER_PSEUDO_ID_FIELD_NUMBER; + hash = (53 * hash) + getUserPseudoId().hashCode(); + if (hasEventTime()) { + hash = (37 * hash) + EVENT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEventTime().hashCode(); + } + if (hasUserInfo()) { + hash = (37 * hash) + USER_INFO_FIELD_NUMBER; + hash = (53 * hash) + getUserInfo().hashCode(); + } + hash = (37 * hash) + DIRECT_USER_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDirectUserRequest()); + hash = (37 * hash) + SESSION_ID_FIELD_NUMBER; + hash = (53 * hash) + getSessionId().hashCode(); + if (hasPageInfo()) { + hash = (37 * hash) + PAGE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getPageInfo().hashCode(); + } + hash = (37 * hash) + ATTRIBUTION_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getAttributionToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + if (getDocumentsCount() > 0) { + hash = (37 * hash) + DOCUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getDocumentsList().hashCode(); + } + if (hasPanel()) { + hash = (37 * hash) + PANEL_FIELD_NUMBER; + hash = (53 * hash) + getPanel().hashCode(); + } + if (hasSearchInfo()) { + hash = (37 * hash) + SEARCH_INFO_FIELD_NUMBER; + hash = (53 * hash) + getSearchInfo().hashCode(); + } + if (hasCompletionInfo()) { + hash = (37 * hash) + COMPLETION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getCompletionInfo().hashCode(); + } + if (hasTransactionInfo()) { + hash = (37 * hash) + TRANSACTION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getTransactionInfo().hashCode(); + } + if (getTagIdsCount() > 0) { + hash = (37 * hash) + TAG_IDS_FIELD_NUMBER; + hash = (53 * hash) + getTagIdsList().hashCode(); + } + if (getPromotionIdsCount() > 0) { + hash = (37 * hash) + PROMOTION_IDS_FIELD_NUMBER; + hash = (53 * hash) + getPromotionIdsList().hashCode(); + } + if (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + if (hasMediaInfo()) { + hash = (37 * hash) + MEDIA_INFO_FIELD_NUMBER; + hash = (53 * hash) + getMediaInfo().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.UserEvent parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.UserEvent parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.UserEvent parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEvent parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEvent parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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 Discovery Engine API needs to
+   * know about how end users interact with customers' website.
+   * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.UserEvent} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.UserEvent) + com.google.cloud.discoveryengine.v1alpha.UserEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_UserEvent_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 17: + return internalGetAttributes(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 17: + 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.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_UserEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.UserEvent.class, + com.google.cloud.discoveryengine.v1alpha.UserEvent.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.UserEvent.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + eventType_ = ""; + userPseudoId_ = ""; + eventTime_ = null; + if (eventTimeBuilder_ != null) { + eventTimeBuilder_.dispose(); + eventTimeBuilder_ = null; + } + userInfo_ = null; + if (userInfoBuilder_ != null) { + userInfoBuilder_.dispose(); + userInfoBuilder_ = null; + } + directUserRequest_ = false; + sessionId_ = ""; + pageInfo_ = null; + if (pageInfoBuilder_ != null) { + pageInfoBuilder_.dispose(); + pageInfoBuilder_ = null; + } + attributionToken_ = ""; + filter_ = ""; + if (documentsBuilder_ == null) { + documents_ = java.util.Collections.emptyList(); + } else { + documents_ = null; + documentsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000200); + panel_ = null; + if (panelBuilder_ != null) { + panelBuilder_.dispose(); + panelBuilder_ = null; + } + searchInfo_ = null; + if (searchInfoBuilder_ != null) { + searchInfoBuilder_.dispose(); + searchInfoBuilder_ = null; + } + completionInfo_ = null; + if (completionInfoBuilder_ != null) { + completionInfoBuilder_.dispose(); + completionInfoBuilder_ = null; + } + transactionInfo_ = null; + if (transactionInfoBuilder_ != null) { + transactionInfoBuilder_.dispose(); + transactionInfoBuilder_ = null; + } + tagIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + promotionIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + internalGetMutableAttributes().clear(); + mediaInfo_ = null; + if (mediaInfoBuilder_ != null) { + mediaInfoBuilder_.dispose(); + mediaInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.UserEventProto + .internal_static_google_cloud_discoveryengine_v1alpha_UserEvent_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UserEvent getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.UserEvent.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UserEvent build() { + com.google.cloud.discoveryengine.v1alpha.UserEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UserEvent buildPartial() { + com.google.cloud.discoveryengine.v1alpha.UserEvent result = + new com.google.cloud.discoveryengine.v1alpha.UserEvent(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.discoveryengine.v1alpha.UserEvent result) { + if (documentsBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0)) { + documents_ = java.util.Collections.unmodifiableList(documents_); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.documents_ = documents_; + } else { + result.documents_ = documentsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.UserEvent result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.eventType_ = eventType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.userPseudoId_ = userPseudoId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.eventTime_ = eventTimeBuilder_ == null ? eventTime_ : eventTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.userInfo_ = userInfoBuilder_ == null ? userInfo_ : userInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.directUserRequest_ = directUserRequest_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.sessionId_ = sessionId_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.pageInfo_ = pageInfoBuilder_ == null ? pageInfo_ : pageInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.attributionToken_ = attributionToken_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.panel_ = panelBuilder_ == null ? panel_ : panelBuilder_.build(); + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.searchInfo_ = searchInfoBuilder_ == null ? searchInfo_ : searchInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.completionInfo_ = + completionInfoBuilder_ == null ? completionInfo_ : completionInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.transactionInfo_ = + transactionInfoBuilder_ == null ? transactionInfo_ : transactionInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00004000) != 0)) { + tagIds_.makeImmutable(); + result.tagIds_ = tagIds_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + promotionIds_.makeImmutable(); + result.promotionIds_ = promotionIds_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.attributes_ = internalGetAttributes(); + result.attributes_.makeImmutable(); + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.mediaInfo_ = mediaInfoBuilder_ == null ? mediaInfo_ : mediaInfoBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.UserEvent) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.UserEvent) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.UserEvent other) { + if (other == com.google.cloud.discoveryengine.v1alpha.UserEvent.getDefaultInstance()) + return this; + if (!other.getEventType().isEmpty()) { + eventType_ = other.eventType_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUserPseudoId().isEmpty()) { + userPseudoId_ = other.userPseudoId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasEventTime()) { + mergeEventTime(other.getEventTime()); + } + if (other.hasUserInfo()) { + mergeUserInfo(other.getUserInfo()); + } + if (other.getDirectUserRequest() != false) { + setDirectUserRequest(other.getDirectUserRequest()); + } + if (!other.getSessionId().isEmpty()) { + sessionId_ = other.sessionId_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.hasPageInfo()) { + mergePageInfo(other.getPageInfo()); + } + if (!other.getAttributionToken().isEmpty()) { + attributionToken_ = other.attributionToken_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000100; + onChanged(); + } + if (documentsBuilder_ == null) { + if (!other.documents_.isEmpty()) { + if (documents_.isEmpty()) { + documents_ = other.documents_; + bitField0_ = (bitField0_ & ~0x00000200); + } else { + ensureDocumentsIsMutable(); + documents_.addAll(other.documents_); + } + onChanged(); + } + } else { + if (!other.documents_.isEmpty()) { + if (documentsBuilder_.isEmpty()) { + documentsBuilder_.dispose(); + documentsBuilder_ = null; + documents_ = other.documents_; + bitField0_ = (bitField0_ & ~0x00000200); + documentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDocumentsFieldBuilder() + : null; + } else { + documentsBuilder_.addAllMessages(other.documents_); + } + } + } + if (other.hasPanel()) { + mergePanel(other.getPanel()); + } + if (other.hasSearchInfo()) { + mergeSearchInfo(other.getSearchInfo()); + } + if (other.hasCompletionInfo()) { + mergeCompletionInfo(other.getCompletionInfo()); + } + if (other.hasTransactionInfo()) { + mergeTransactionInfo(other.getTransactionInfo()); + } + if (!other.tagIds_.isEmpty()) { + if (tagIds_.isEmpty()) { + tagIds_ = other.tagIds_; + bitField0_ |= 0x00004000; + } else { + ensureTagIdsIsMutable(); + tagIds_.addAll(other.tagIds_); + } + onChanged(); + } + if (!other.promotionIds_.isEmpty()) { + if (promotionIds_.isEmpty()) { + promotionIds_ = other.promotionIds_; + bitField0_ |= 0x00008000; + } else { + ensurePromotionIdsIsMutable(); + promotionIds_.addAll(other.promotionIds_); + } + onChanged(); + } + internalGetMutableAttributes().mergeFrom(other.internalGetAttributes()); + bitField0_ |= 0x00010000; + if (other.hasMediaInfo()) { + mergeMediaInfo(other.getMediaInfo()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + eventType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + userPseudoId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getEventTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getUserInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + directUserRequest_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: + { + sessionId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage(getPageInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + attributionToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 82: + { + com.google.cloud.discoveryengine.v1alpha.DocumentInfo m = + input.readMessage( + com.google.cloud.discoveryengine.v1alpha.DocumentInfo.parser(), + extensionRegistry); + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + documents_.add(m); + } else { + documentsBuilder_.addMessage(m); + } + break; + } // case 82 + case 90: + { + input.readMessage(getPanelFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 98: + { + input.readMessage(getSearchInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 106: + { + input.readMessage(getCompletionInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00001000; + break; + } // case 106 + case 114: + { + input.readMessage(getTransactionInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 114 + case 122: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureTagIdsIsMutable(); + tagIds_.add(s); + break; + } // case 122 + case 130: + { + java.lang.String s = input.readStringRequireUtf8(); + ensurePromotionIdsIsMutable(); + promotionIds_.add(s); + break; + } // case 130 + case 138: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.discoveryengine.v1alpha.CustomAttribute> + attributes__ = + input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAttributes() + .getMutableMap() + .put(attributes__.getKey(), attributes__.getValue()); + bitField0_ |= 0x00010000; + break; + } // case 138 + case 146: + { + input.readMessage(getMediaInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00020000; + break; + } // case 146 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object eventType_ = ""; + /** + * + * + *
+     * Required. User event type. Allowed values are:
+     *
+     * Generic values:
+     *
+     * * `search`: Search for Documents.
+     * * `view-item`: Detailed page view of a Document.
+     * * `view-item-list`: View of a panel or ordered list of Documents.
+     * * `view-home-page`: View of the home page.
+     * * `view-category-page`: View of a category page, e.g. Home > Men > Jeans
+     *
+     * Retail-related values:
+     *
+     * * `add-to-cart`: Add an item(s) to cart, e.g. in Retail online shopping
+     * * `purchase`: Purchase an item(s)
+     *
+     * Media-related values:
+     *
+     * * `media-play`: Start/resume watching a video, playing a song, etc.
+     * * `media-complete`: Finished or stopped midway through a video, song, etc.
+     * 
+ * + * 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:
+     *
+     * Generic values:
+     *
+     * * `search`: Search for Documents.
+     * * `view-item`: Detailed page view of a Document.
+     * * `view-item-list`: View of a panel or ordered list of Documents.
+     * * `view-home-page`: View of the home page.
+     * * `view-category-page`: View of a category page, e.g. Home > Men > Jeans
+     *
+     * Retail-related values:
+     *
+     * * `add-to-cart`: Add an item(s) to cart, e.g. in Retail online shopping
+     * * `purchase`: Purchase an item(s)
+     *
+     * Media-related values:
+     *
+     * * `media-play`: Start/resume watching a video, playing a song, etc.
+     * * `media-complete`: Finished or stopped midway through a video, song, etc.
+     * 
+ * + * 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:
+     *
+     * Generic values:
+     *
+     * * `search`: Search for Documents.
+     * * `view-item`: Detailed page view of a Document.
+     * * `view-item-list`: View of a panel or ordered list of Documents.
+     * * `view-home-page`: View of the home page.
+     * * `view-category-page`: View of a category page, e.g. Home > Men > Jeans
+     *
+     * Retail-related values:
+     *
+     * * `add-to-cart`: Add an item(s) to cart, e.g. in Retail online shopping
+     * * `purchase`: Purchase an item(s)
+     *
+     * Media-related values:
+     *
+     * * `media-play`: Start/resume watching a video, playing a song, etc.
+     * * `media-complete`: Finished or stopped midway through a video, song, etc.
+     * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. User event type. Allowed values are:
+     *
+     * Generic values:
+     *
+     * * `search`: Search for Documents.
+     * * `view-item`: Detailed page view of a Document.
+     * * `view-item-list`: View of a panel or ordered list of Documents.
+     * * `view-home-page`: View of the home page.
+     * * `view-category-page`: View of a category page, e.g. Home > Men > Jeans
+     *
+     * Retail-related values:
+     *
+     * * `add-to-cart`: Add an item(s) to cart, e.g. in Retail online shopping
+     * * `purchase`: Purchase an item(s)
+     *
+     * Media-related values:
+     *
+     * * `media-play`: Start/resume watching a video, playing a song, etc.
+     * * `media-complete`: Finished or stopped midway through a video, song, etc.
+     * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearEventType() { + eventType_ = getDefaultInstance().getEventType(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. User event type. Allowed values are:
+     *
+     * Generic values:
+     *
+     * * `search`: Search for Documents.
+     * * `view-item`: Detailed page view of a Document.
+     * * `view-item-list`: View of a panel or ordered list of Documents.
+     * * `view-home-page`: View of the home page.
+     * * `view-category-page`: View of a category page, e.g. Home > Men > Jeans
+     *
+     * Retail-related values:
+     *
+     * * `add-to-cart`: Add an item(s) to cart, e.g. in Retail online shopping
+     * * `purchase`: Purchase an item(s)
+     *
+     * Media-related values:
+     *
+     * * `media-play`: Start/resume watching a video, playing a song, etc.
+     * * `media-complete`: Finished or stopped midway through a video, song, etc.
+     * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object userPseudoId_ = ""; + /** + * + * + *
+     * 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.
+     *
+     * Do not set the field to the same fixed ID for different users. This mixes
+     * the event history of those users together, which results in degraded model
+     * quality.
+     *
+     * 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
+     * Analytics [Client
+     * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+     * for this field.
+     * 
+ * + * string user_pseudo_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The userPseudoId. + */ + public java.lang.String getUserPseudoId() { + java.lang.Object ref = userPseudoId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userPseudoId_ = 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.
+     *
+     * Do not set the field to the same fixed ID for different users. This mixes
+     * the event history of those users together, which results in degraded model
+     * quality.
+     *
+     * 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
+     * Analytics [Client
+     * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+     * for this field.
+     * 
+ * + * string user_pseudo_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for userPseudoId. + */ + public com.google.protobuf.ByteString getUserPseudoIdBytes() { + java.lang.Object ref = userPseudoId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userPseudoId_ = 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.
+     *
+     * Do not set the field to the same fixed ID for different users. This mixes
+     * the event history of those users together, which results in degraded model
+     * quality.
+     *
+     * 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
+     * Analytics [Client
+     * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+     * for this field.
+     * 
+ * + * string user_pseudo_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The userPseudoId to set. + * @return This builder for chaining. + */ + public Builder setUserPseudoId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + userPseudoId_ = value; + bitField0_ |= 0x00000002; + 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.
+     *
+     * Do not set the field to the same fixed ID for different users. This mixes
+     * the event history of those users together, which results in degraded model
+     * quality.
+     *
+     * 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
+     * Analytics [Client
+     * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+     * for this field.
+     * 
+ * + * string user_pseudo_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearUserPseudoId() { + userPseudoId_ = getDefaultInstance().getUserPseudoId(); + bitField0_ = (bitField0_ & ~0x00000002); + 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.
+     *
+     * Do not set the field to the same fixed ID for different users. This mixes
+     * the event history of those users together, which results in degraded model
+     * quality.
+     *
+     * 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
+     * Analytics [Client
+     * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+     * for this field.
+     * 
+ * + * string user_pseudo_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for userPseudoId to set. + * @return This builder for chaining. + */ + public Builder setUserPseudoIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + userPseudoId_ = value; + bitField0_ |= 0x00000002; + 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.discoveryengine.v1alpha.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 ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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; + } else { + eventTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.discoveryengine.v1alpha.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(); + } else { + eventTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.discoveryengine.v1alpha.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 (((bitField0_ & 0x00000004) != 0) + && eventTime_ != null + && eventTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEventTimeBuilder().mergeFrom(value); + } else { + eventTime_ = value; + } + } else { + eventTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.discoveryengine.v1alpha.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 3; + */ + public Builder clearEventTime() { + bitField0_ = (bitField0_ & ~0x00000004); + eventTime_ = null; + if (eventTimeBuilder_ != null) { + eventTimeBuilder_.dispose(); + eventTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.discoveryengine.v1alpha.UserEventService.ImportUserEvents]
+     * method. Timestamp of when the user event happened.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getEventTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getEventTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Only required for
+     * [UserEventService.ImportUserEvents][google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.cloud.discoveryengine.v1alpha.UserInfo userInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.UserInfo, + com.google.cloud.discoveryengine.v1alpha.UserInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.UserInfoOrBuilder> + userInfoBuilder_; + /** + * + * + *
+     * Information about the end user.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 4; + * + * @return Whether the userInfo field is set. + */ + public boolean hasUserInfo() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Information about the end user.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 4; + * + * @return The userInfo. + */ + public com.google.cloud.discoveryengine.v1alpha.UserInfo getUserInfo() { + if (userInfoBuilder_ == null) { + return userInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.UserInfo.getDefaultInstance() + : userInfo_; + } else { + return userInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Information about the end user.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 4; + */ + public Builder setUserInfo(com.google.cloud.discoveryengine.v1alpha.UserInfo value) { + if (userInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userInfo_ = value; + } else { + userInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Information about the end user.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 4; + */ + public Builder setUserInfo( + com.google.cloud.discoveryengine.v1alpha.UserInfo.Builder builderForValue) { + if (userInfoBuilder_ == null) { + userInfo_ = builderForValue.build(); + } else { + userInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Information about the end user.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 4; + */ + public Builder mergeUserInfo(com.google.cloud.discoveryengine.v1alpha.UserInfo value) { + if (userInfoBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && userInfo_ != null + && userInfo_ + != com.google.cloud.discoveryengine.v1alpha.UserInfo.getDefaultInstance()) { + getUserInfoBuilder().mergeFrom(value); + } else { + userInfo_ = value; + } + } else { + userInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Information about the end user.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 4; + */ + public Builder clearUserInfo() { + bitField0_ = (bitField0_ & ~0x00000008); + userInfo_ = null; + if (userInfoBuilder_ != null) { + userInfoBuilder_.dispose(); + userInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Information about the end user.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 4; + */ + public com.google.cloud.discoveryengine.v1alpha.UserInfo.Builder getUserInfoBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getUserInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Information about the end user.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 4; + */ + public com.google.cloud.discoveryengine.v1alpha.UserInfoOrBuilder getUserInfoOrBuilder() { + if (userInfoBuilder_ != null) { + return userInfoBuilder_.getMessageOrBuilder(); + } else { + return userInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.UserInfo.getDefaultInstance() + : userInfo_; + } + } + /** + * + * + *
+     * Information about the end user.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.UserInfo, + com.google.cloud.discoveryengine.v1alpha.UserInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.UserInfoOrBuilder> + getUserInfoFieldBuilder() { + if (userInfoBuilder_ == null) { + userInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.UserInfo, + com.google.cloud.discoveryengine.v1alpha.UserInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.UserInfoOrBuilder>( + getUserInfo(), getParentForChildren(), isClean()); + userInfo_ = null; + } + return userInfoBuilder_; + } + + private boolean directUserRequest_; + /** + * + * + *
+     * Should set to true if the request is made directly from the end user, in
+     * which case the
+     * [UserEvent.user_info.user_agent][google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEventService.CollectUserEvent].
+     * 
+ * + * bool direct_user_request = 5; + * + * @return The directUserRequest. + */ + @java.lang.Override + public boolean getDirectUserRequest() { + return directUserRequest_; + } + /** + * + * + *
+     * Should set to true if the request is made directly from the end user, in
+     * which case the
+     * [UserEvent.user_info.user_agent][google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEventService.CollectUserEvent].
+     * 
+ * + * bool direct_user_request = 5; + * + * @param value The directUserRequest to set. + * @return This builder for chaining. + */ + public Builder setDirectUserRequest(boolean value) { + + directUserRequest_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Should set to true if the request is made directly from the end user, in
+     * which case the
+     * [UserEvent.user_info.user_agent][google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEventService.CollectUserEvent].
+     * 
+ * + * bool direct_user_request = 5; + * + * @return This builder for chaining. + */ + public Builder clearDirectUserRequest() { + bitField0_ = (bitField0_ & ~0x00000010); + directUserRequest_ = false; + 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 session_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
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * as prefix.
+     * 
+ * + * string session_id = 6; + * + * @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 session_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
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * as prefix.
+     * 
+ * + * string session_id = 6; + * + * @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 session_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
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * as prefix.
+     * 
+ * + * string session_id = 6; + * + * @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; + bitField0_ |= 0x00000020; + 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 session_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
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * as prefix.
+     * 
+ * + * string session_id = 6; + * + * @return This builder for chaining. + */ + public Builder clearSessionId() { + sessionId_ = getDefaultInstance().getSessionId(); + bitField0_ = (bitField0_ & ~0x00000020); + 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 session_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
+     * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+     * as prefix.
+     * 
+ * + * string session_id = 6; + * + * @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; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1alpha.PageInfo pageInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.PageInfo, + com.google.cloud.discoveryengine.v1alpha.PageInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.PageInfoOrBuilder> + pageInfoBuilder_; + /** + * + * + *
+     * Page metadata such as categories and other critical information for certain
+     * event types such as `view-category-page`.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.PageInfo page_info = 7; + * + * @return Whether the pageInfo field is set. + */ + public boolean hasPageInfo() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * Page metadata such as categories and other critical information for certain
+     * event types such as `view-category-page`.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.PageInfo page_info = 7; + * + * @return The pageInfo. + */ + public com.google.cloud.discoveryengine.v1alpha.PageInfo getPageInfo() { + if (pageInfoBuilder_ == null) { + return pageInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.PageInfo.getDefaultInstance() + : pageInfo_; + } else { + return pageInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Page metadata such as categories and other critical information for certain
+     * event types such as `view-category-page`.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.PageInfo page_info = 7; + */ + public Builder setPageInfo(com.google.cloud.discoveryengine.v1alpha.PageInfo value) { + if (pageInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pageInfo_ = value; + } else { + pageInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Page metadata such as categories and other critical information for certain
+     * event types such as `view-category-page`.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.PageInfo page_info = 7; + */ + public Builder setPageInfo( + com.google.cloud.discoveryengine.v1alpha.PageInfo.Builder builderForValue) { + if (pageInfoBuilder_ == null) { + pageInfo_ = builderForValue.build(); + } else { + pageInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Page metadata such as categories and other critical information for certain
+     * event types such as `view-category-page`.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.PageInfo page_info = 7; + */ + public Builder mergePageInfo(com.google.cloud.discoveryengine.v1alpha.PageInfo value) { + if (pageInfoBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && pageInfo_ != null + && pageInfo_ + != com.google.cloud.discoveryengine.v1alpha.PageInfo.getDefaultInstance()) { + getPageInfoBuilder().mergeFrom(value); + } else { + pageInfo_ = value; + } + } else { + pageInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Page metadata such as categories and other critical information for certain
+     * event types such as `view-category-page`.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.PageInfo page_info = 7; + */ + public Builder clearPageInfo() { + bitField0_ = (bitField0_ & ~0x00000040); + pageInfo_ = null; + if (pageInfoBuilder_ != null) { + pageInfoBuilder_.dispose(); + pageInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Page metadata such as categories and other critical information for certain
+     * event types such as `view-category-page`.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.PageInfo page_info = 7; + */ + public com.google.cloud.discoveryengine.v1alpha.PageInfo.Builder getPageInfoBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getPageInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Page metadata such as categories and other critical information for certain
+     * event types such as `view-category-page`.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.PageInfo page_info = 7; + */ + public com.google.cloud.discoveryengine.v1alpha.PageInfoOrBuilder getPageInfoOrBuilder() { + if (pageInfoBuilder_ != null) { + return pageInfoBuilder_.getMessageOrBuilder(); + } else { + return pageInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.PageInfo.getDefaultInstance() + : pageInfo_; + } + } + /** + * + * + *
+     * Page metadata such as categories and other critical information for certain
+     * event types such as `view-category-page`.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.PageInfo page_info = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.PageInfo, + com.google.cloud.discoveryengine.v1alpha.PageInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.PageInfoOrBuilder> + getPageInfoFieldBuilder() { + if (pageInfoBuilder_ == null) { + pageInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.PageInfo, + com.google.cloud.discoveryengine.v1alpha.PageInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.PageInfoOrBuilder>( + getPageInfo(), getParentForChildren(), isClean()); + pageInfo_ = null; + } + return pageInfoBuilder_; + } + + private java.lang.Object attributionToken_ = ""; + /** + * + * + *
+     * Token to attribute an API response to user action(s) to trigger the event.
+     *
+     * Highly recommended for user events that are the result of
+     * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+     * This field enables accurate attribution of recommendation model
+     * performance.
+     *
+     * The value must be one of:
+     *
+     * * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token] for events that are the result of
+     * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+     * * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1alpha.SearchResponse.attribution_token] for events that are the result of
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+     *
+     * This token enables us to accurately attribute page view or conversion
+     * completion 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
+     * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token]
+     * as a URL parameter to product K's page. When recording events on product
+     * K's page, log the
+     * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token]
+     * to this field.
+     * 
+ * + * string attribution_token = 8; + * + * @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; + } + } + /** + * + * + *
+     * Token to attribute an API response to user action(s) to trigger the event.
+     *
+     * Highly recommended for user events that are the result of
+     * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+     * This field enables accurate attribution of recommendation model
+     * performance.
+     *
+     * The value must be one of:
+     *
+     * * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token] for events that are the result of
+     * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+     * * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1alpha.SearchResponse.attribution_token] for events that are the result of
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+     *
+     * This token enables us to accurately attribute page view or conversion
+     * completion 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
+     * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token]
+     * as a URL parameter to product K's page. When recording events on product
+     * K's page, log the
+     * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token]
+     * to this field.
+     * 
+ * + * string attribution_token = 8; + * + * @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; + } + } + /** + * + * + *
+     * Token to attribute an API response to user action(s) to trigger the event.
+     *
+     * Highly recommended for user events that are the result of
+     * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+     * This field enables accurate attribution of recommendation model
+     * performance.
+     *
+     * The value must be one of:
+     *
+     * * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token] for events that are the result of
+     * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+     * * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1alpha.SearchResponse.attribution_token] for events that are the result of
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+     *
+     * This token enables us to accurately attribute page view or conversion
+     * completion 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
+     * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token]
+     * as a URL parameter to product K's page. When recording events on product
+     * K's page, log the
+     * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token]
+     * to this field.
+     * 
+ * + * string attribution_token = 8; + * + * @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; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to attribute an API response to user action(s) to trigger the event.
+     *
+     * Highly recommended for user events that are the result of
+     * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+     * This field enables accurate attribution of recommendation model
+     * performance.
+     *
+     * The value must be one of:
+     *
+     * * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token] for events that are the result of
+     * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+     * * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1alpha.SearchResponse.attribution_token] for events that are the result of
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+     *
+     * This token enables us to accurately attribute page view or conversion
+     * completion 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
+     * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token]
+     * as a URL parameter to product K's page. When recording events on product
+     * K's page, log the
+     * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token]
+     * to this field.
+     * 
+ * + * string attribution_token = 8; + * + * @return This builder for chaining. + */ + public Builder clearAttributionToken() { + attributionToken_ = getDefaultInstance().getAttributionToken(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to attribute an API response to user action(s) to trigger the event.
+     *
+     * Highly recommended for user events that are the result of
+     * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+     * This field enables accurate attribution of recommendation model
+     * performance.
+     *
+     * The value must be one of:
+     *
+     * * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token] for events that are the result of
+     * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+     * * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1alpha.SearchResponse.attribution_token] for events that are the result of
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+     *
+     * This token enables us to accurately attribute page view or conversion
+     * completion 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
+     * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token]
+     * as a URL parameter to product K's page. When recording events on product
+     * K's page, log the
+     * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token]
+     * to this field.
+     * 
+ * + * string attribution_token = 8; + * + * @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; + bitField0_ |= 0x00000080; + 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 documents being filtered.
+     *
+     * One example is for `search` events, the associated
+     * [SearchRequest][google.cloud.discoveryengine.v1alpha.SearchRequest] may
+     * contain a filter expression in
+     * [SearchRequest.filter][google.cloud.discoveryengine.v1alpha.SearchRequest.filter]
+     * conforming to https://google.aip.dev/160#filtering.
+     *
+     * Similarly, for `view-item-list` events that are generated from a
+     * [RecommendationService.RecommendRequest][], this field may be populated
+     * directly from [RecommendationService.RecommendRequest.filter][] conforming
+     * to https://google.aip.dev/160#filtering.
+     *
+     * 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 = 9; + * + * @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 documents being filtered.
+     *
+     * One example is for `search` events, the associated
+     * [SearchRequest][google.cloud.discoveryengine.v1alpha.SearchRequest] may
+     * contain a filter expression in
+     * [SearchRequest.filter][google.cloud.discoveryengine.v1alpha.SearchRequest.filter]
+     * conforming to https://google.aip.dev/160#filtering.
+     *
+     * Similarly, for `view-item-list` events that are generated from a
+     * [RecommendationService.RecommendRequest][], this field may be populated
+     * directly from [RecommendationService.RecommendRequest.filter][] conforming
+     * to https://google.aip.dev/160#filtering.
+     *
+     * 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 = 9; + * + * @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 documents being filtered.
+     *
+     * One example is for `search` events, the associated
+     * [SearchRequest][google.cloud.discoveryengine.v1alpha.SearchRequest] may
+     * contain a filter expression in
+     * [SearchRequest.filter][google.cloud.discoveryengine.v1alpha.SearchRequest.filter]
+     * conforming to https://google.aip.dev/160#filtering.
+     *
+     * Similarly, for `view-item-list` events that are generated from a
+     * [RecommendationService.RecommendRequest][], this field may be populated
+     * directly from [RecommendationService.RecommendRequest.filter][] conforming
+     * to https://google.aip.dev/160#filtering.
+     *
+     * 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 = 9; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the documents being filtered.
+     *
+     * One example is for `search` events, the associated
+     * [SearchRequest][google.cloud.discoveryengine.v1alpha.SearchRequest] may
+     * contain a filter expression in
+     * [SearchRequest.filter][google.cloud.discoveryengine.v1alpha.SearchRequest.filter]
+     * conforming to https://google.aip.dev/160#filtering.
+     *
+     * Similarly, for `view-item-list` events that are generated from a
+     * [RecommendationService.RecommendRequest][], this field may be populated
+     * directly from [RecommendationService.RecommendRequest.filter][] conforming
+     * to https://google.aip.dev/160#filtering.
+     *
+     * 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 = 9; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + /** + * + * + *
+     * The filter syntax consists of an expression language for constructing a
+     * predicate from one or more fields of the documents being filtered.
+     *
+     * One example is for `search` events, the associated
+     * [SearchRequest][google.cloud.discoveryengine.v1alpha.SearchRequest] may
+     * contain a filter expression in
+     * [SearchRequest.filter][google.cloud.discoveryengine.v1alpha.SearchRequest.filter]
+     * conforming to https://google.aip.dev/160#filtering.
+     *
+     * Similarly, for `view-item-list` events that are generated from a
+     * [RecommendationService.RecommendRequest][], this field may be populated
+     * directly from [RecommendationService.RecommendRequest.filter][] conforming
+     * to https://google.aip.dev/160#filtering.
+     *
+     * 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 = 9; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private java.util.List documents_ = + java.util.Collections.emptyList(); + + private void ensureDocumentsIsMutable() { + if (!((bitField0_ & 0x00000200) != 0)) { + documents_ = + new java.util.ArrayList( + documents_); + bitField0_ |= 0x00000200; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.DocumentInfo, + com.google.cloud.discoveryengine.v1alpha.DocumentInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.DocumentInfoOrBuilder> + documentsBuilder_; + + /** + * + * + *
+     * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+     * associated with this user event.
+     *
+     * This field is optional except for the following event types:
+     *
+     * * `view-item`
+     * * `add-to-cart`
+     * * `purchase`
+     * * `media-play`
+     * * `media-complete`
+     *
+     * In a `search` event, this field represents the documents 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
+     * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+     * is desired.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + public java.util.List + getDocumentsList() { + if (documentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(documents_); + } else { + return documentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+     * associated with this user event.
+     *
+     * This field is optional except for the following event types:
+     *
+     * * `view-item`
+     * * `add-to-cart`
+     * * `purchase`
+     * * `media-play`
+     * * `media-complete`
+     *
+     * In a `search` event, this field represents the documents 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
+     * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+     * is desired.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + public int getDocumentsCount() { + if (documentsBuilder_ == null) { + return documents_.size(); + } else { + return documentsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+     * associated with this user event.
+     *
+     * This field is optional except for the following event types:
+     *
+     * * `view-item`
+     * * `add-to-cart`
+     * * `purchase`
+     * * `media-play`
+     * * `media-complete`
+     *
+     * In a `search` event, this field represents the documents 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
+     * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+     * is desired.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + public com.google.cloud.discoveryengine.v1alpha.DocumentInfo getDocuments(int index) { + if (documentsBuilder_ == null) { + return documents_.get(index); + } else { + return documentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+     * associated with this user event.
+     *
+     * This field is optional except for the following event types:
+     *
+     * * `view-item`
+     * * `add-to-cart`
+     * * `purchase`
+     * * `media-play`
+     * * `media-complete`
+     *
+     * In a `search` event, this field represents the documents 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
+     * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+     * is desired.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + public Builder setDocuments( + int index, com.google.cloud.discoveryengine.v1alpha.DocumentInfo value) { + if (documentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentsIsMutable(); + documents_.set(index, value); + onChanged(); + } else { + documentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+     * associated with this user event.
+     *
+     * This field is optional except for the following event types:
+     *
+     * * `view-item`
+     * * `add-to-cart`
+     * * `purchase`
+     * * `media-play`
+     * * `media-complete`
+     *
+     * In a `search` event, this field represents the documents 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
+     * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+     * is desired.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + public Builder setDocuments( + int index, com.google.cloud.discoveryengine.v1alpha.DocumentInfo.Builder builderForValue) { + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + documents_.set(index, builderForValue.build()); + onChanged(); + } else { + documentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+     * associated with this user event.
+     *
+     * This field is optional except for the following event types:
+     *
+     * * `view-item`
+     * * `add-to-cart`
+     * * `purchase`
+     * * `media-play`
+     * * `media-complete`
+     *
+     * In a `search` event, this field represents the documents 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
+     * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+     * is desired.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + public Builder addDocuments(com.google.cloud.discoveryengine.v1alpha.DocumentInfo value) { + if (documentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentsIsMutable(); + documents_.add(value); + onChanged(); + } else { + documentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+     * associated with this user event.
+     *
+     * This field is optional except for the following event types:
+     *
+     * * `view-item`
+     * * `add-to-cart`
+     * * `purchase`
+     * * `media-play`
+     * * `media-complete`
+     *
+     * In a `search` event, this field represents the documents 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
+     * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+     * is desired.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + public Builder addDocuments( + int index, com.google.cloud.discoveryengine.v1alpha.DocumentInfo value) { + if (documentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentsIsMutable(); + documents_.add(index, value); + onChanged(); + } else { + documentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+     * associated with this user event.
+     *
+     * This field is optional except for the following event types:
+     *
+     * * `view-item`
+     * * `add-to-cart`
+     * * `purchase`
+     * * `media-play`
+     * * `media-complete`
+     *
+     * In a `search` event, this field represents the documents 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
+     * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+     * is desired.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + public Builder addDocuments( + com.google.cloud.discoveryengine.v1alpha.DocumentInfo.Builder builderForValue) { + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + documents_.add(builderForValue.build()); + onChanged(); + } else { + documentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+     * associated with this user event.
+     *
+     * This field is optional except for the following event types:
+     *
+     * * `view-item`
+     * * `add-to-cart`
+     * * `purchase`
+     * * `media-play`
+     * * `media-complete`
+     *
+     * In a `search` event, this field represents the documents 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
+     * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+     * is desired.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + public Builder addDocuments( + int index, com.google.cloud.discoveryengine.v1alpha.DocumentInfo.Builder builderForValue) { + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + documents_.add(index, builderForValue.build()); + onChanged(); + } else { + documentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+     * associated with this user event.
+     *
+     * This field is optional except for the following event types:
+     *
+     * * `view-item`
+     * * `add-to-cart`
+     * * `purchase`
+     * * `media-play`
+     * * `media-complete`
+     *
+     * In a `search` event, this field represents the documents 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
+     * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+     * is desired.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + public Builder addAllDocuments( + java.lang.Iterable + values) { + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, documents_); + onChanged(); + } else { + documentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+     * associated with this user event.
+     *
+     * This field is optional except for the following event types:
+     *
+     * * `view-item`
+     * * `add-to-cart`
+     * * `purchase`
+     * * `media-play`
+     * * `media-complete`
+     *
+     * In a `search` event, this field represents the documents 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
+     * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+     * is desired.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + public Builder clearDocuments() { + if (documentsBuilder_ == null) { + documents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + } else { + documentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+     * associated with this user event.
+     *
+     * This field is optional except for the following event types:
+     *
+     * * `view-item`
+     * * `add-to-cart`
+     * * `purchase`
+     * * `media-play`
+     * * `media-complete`
+     *
+     * In a `search` event, this field represents the documents 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
+     * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+     * is desired.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + public Builder removeDocuments(int index) { + if (documentsBuilder_ == null) { + ensureDocumentsIsMutable(); + documents_.remove(index); + onChanged(); + } else { + documentsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+     * associated with this user event.
+     *
+     * This field is optional except for the following event types:
+     *
+     * * `view-item`
+     * * `add-to-cart`
+     * * `purchase`
+     * * `media-play`
+     * * `media-complete`
+     *
+     * In a `search` event, this field represents the documents 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
+     * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+     * is desired.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + public com.google.cloud.discoveryengine.v1alpha.DocumentInfo.Builder getDocumentsBuilder( + int index) { + return getDocumentsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+     * associated with this user event.
+     *
+     * This field is optional except for the following event types:
+     *
+     * * `view-item`
+     * * `add-to-cart`
+     * * `purchase`
+     * * `media-play`
+     * * `media-complete`
+     *
+     * In a `search` event, this field represents the documents 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
+     * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+     * is desired.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + public com.google.cloud.discoveryengine.v1alpha.DocumentInfoOrBuilder getDocumentsOrBuilder( + int index) { + if (documentsBuilder_ == null) { + return documents_.get(index); + } else { + return documentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+     * associated with this user event.
+     *
+     * This field is optional except for the following event types:
+     *
+     * * `view-item`
+     * * `add-to-cart`
+     * * `purchase`
+     * * `media-play`
+     * * `media-complete`
+     *
+     * In a `search` event, this field represents the documents 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
+     * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+     * is desired.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + public java.util.List + getDocumentsOrBuilderList() { + if (documentsBuilder_ != null) { + return documentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(documents_); + } + } + /** + * + * + *
+     * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+     * associated with this user event.
+     *
+     * This field is optional except for the following event types:
+     *
+     * * `view-item`
+     * * `add-to-cart`
+     * * `purchase`
+     * * `media-play`
+     * * `media-complete`
+     *
+     * In a `search` event, this field represents the documents 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
+     * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+     * is desired.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + public com.google.cloud.discoveryengine.v1alpha.DocumentInfo.Builder addDocumentsBuilder() { + return getDocumentsFieldBuilder() + .addBuilder(com.google.cloud.discoveryengine.v1alpha.DocumentInfo.getDefaultInstance()); + } + /** + * + * + *
+     * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+     * associated with this user event.
+     *
+     * This field is optional except for the following event types:
+     *
+     * * `view-item`
+     * * `add-to-cart`
+     * * `purchase`
+     * * `media-play`
+     * * `media-complete`
+     *
+     * In a `search` event, this field represents the documents 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
+     * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+     * is desired.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + public com.google.cloud.discoveryengine.v1alpha.DocumentInfo.Builder addDocumentsBuilder( + int index) { + return getDocumentsFieldBuilder() + .addBuilder( + index, com.google.cloud.discoveryengine.v1alpha.DocumentInfo.getDefaultInstance()); + } + /** + * + * + *
+     * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+     * associated with this user event.
+     *
+     * This field is optional except for the following event types:
+     *
+     * * `view-item`
+     * * `add-to-cart`
+     * * `purchase`
+     * * `media-play`
+     * * `media-complete`
+     *
+     * In a `search` event, this field represents the documents 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
+     * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+     * is desired.
+     * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + public java.util.List + getDocumentsBuilderList() { + return getDocumentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.DocumentInfo, + com.google.cloud.discoveryengine.v1alpha.DocumentInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.DocumentInfoOrBuilder> + getDocumentsFieldBuilder() { + if (documentsBuilder_ == null) { + documentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.DocumentInfo, + com.google.cloud.discoveryengine.v1alpha.DocumentInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.DocumentInfoOrBuilder>( + documents_, ((bitField0_ & 0x00000200) != 0), getParentForChildren(), isClean()); + documents_ = null; + } + return documentsBuilder_; + } + + private com.google.cloud.discoveryengine.v1alpha.PanelInfo panel_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.PanelInfo, + com.google.cloud.discoveryengine.v1alpha.PanelInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.PanelInfoOrBuilder> + panelBuilder_; + /** + * + * + *
+     * Panel metadata associated with this user event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.PanelInfo panel = 11; + * + * @return Whether the panel field is set. + */ + public boolean hasPanel() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * + * + *
+     * Panel metadata associated with this user event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.PanelInfo panel = 11; + * + * @return The panel. + */ + public com.google.cloud.discoveryengine.v1alpha.PanelInfo getPanel() { + if (panelBuilder_ == null) { + return panel_ == null + ? com.google.cloud.discoveryengine.v1alpha.PanelInfo.getDefaultInstance() + : panel_; + } else { + return panelBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Panel metadata associated with this user event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.PanelInfo panel = 11; + */ + public Builder setPanel(com.google.cloud.discoveryengine.v1alpha.PanelInfo value) { + if (panelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + panel_ = value; + } else { + panelBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Panel metadata associated with this user event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.PanelInfo panel = 11; + */ + public Builder setPanel( + com.google.cloud.discoveryengine.v1alpha.PanelInfo.Builder builderForValue) { + if (panelBuilder_ == null) { + panel_ = builderForValue.build(); + } else { + panelBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Panel metadata associated with this user event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.PanelInfo panel = 11; + */ + public Builder mergePanel(com.google.cloud.discoveryengine.v1alpha.PanelInfo value) { + if (panelBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && panel_ != null + && panel_ != com.google.cloud.discoveryengine.v1alpha.PanelInfo.getDefaultInstance()) { + getPanelBuilder().mergeFrom(value); + } else { + panel_ = value; + } + } else { + panelBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Panel metadata associated with this user event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.PanelInfo panel = 11; + */ + public Builder clearPanel() { + bitField0_ = (bitField0_ & ~0x00000400); + panel_ = null; + if (panelBuilder_ != null) { + panelBuilder_.dispose(); + panelBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Panel metadata associated with this user event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.PanelInfo panel = 11; + */ + public com.google.cloud.discoveryengine.v1alpha.PanelInfo.Builder getPanelBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getPanelFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Panel metadata associated with this user event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.PanelInfo panel = 11; + */ + public com.google.cloud.discoveryengine.v1alpha.PanelInfoOrBuilder getPanelOrBuilder() { + if (panelBuilder_ != null) { + return panelBuilder_.getMessageOrBuilder(); + } else { + return panel_ == null + ? com.google.cloud.discoveryengine.v1alpha.PanelInfo.getDefaultInstance() + : panel_; + } + } + /** + * + * + *
+     * Panel metadata associated with this user event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.PanelInfo panel = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.PanelInfo, + com.google.cloud.discoveryengine.v1alpha.PanelInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.PanelInfoOrBuilder> + getPanelFieldBuilder() { + if (panelBuilder_ == null) { + panelBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.PanelInfo, + com.google.cloud.discoveryengine.v1alpha.PanelInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.PanelInfoOrBuilder>( + getPanel(), getParentForChildren(), isClean()); + panel_ = null; + } + return panelBuilder_; + } + + private com.google.cloud.discoveryengine.v1alpha.SearchInfo searchInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchInfo, + com.google.cloud.discoveryengine.v1alpha.SearchInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchInfoOrBuilder> + searchInfoBuilder_; + /** + * + * + *
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * details related to the event.
+     *
+     * This field should be set for `search` event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchInfo search_info = 12; + * + * @return Whether the searchInfo field is set. + */ + public boolean hasSearchInfo() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * + * + *
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * details related to the event.
+     *
+     * This field should be set for `search` event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchInfo search_info = 12; + * + * @return The searchInfo. + */ + public com.google.cloud.discoveryengine.v1alpha.SearchInfo getSearchInfo() { + if (searchInfoBuilder_ == null) { + return searchInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchInfo.getDefaultInstance() + : searchInfo_; + } else { + return searchInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * details related to the event.
+     *
+     * This field should be set for `search` event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchInfo search_info = 12; + */ + public Builder setSearchInfo(com.google.cloud.discoveryengine.v1alpha.SearchInfo value) { + if (searchInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + searchInfo_ = value; + } else { + searchInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * details related to the event.
+     *
+     * This field should be set for `search` event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchInfo search_info = 12; + */ + public Builder setSearchInfo( + com.google.cloud.discoveryengine.v1alpha.SearchInfo.Builder builderForValue) { + if (searchInfoBuilder_ == null) { + searchInfo_ = builderForValue.build(); + } else { + searchInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * details related to the event.
+     *
+     * This field should be set for `search` event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchInfo search_info = 12; + */ + public Builder mergeSearchInfo(com.google.cloud.discoveryengine.v1alpha.SearchInfo value) { + if (searchInfoBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && searchInfo_ != null + && searchInfo_ + != com.google.cloud.discoveryengine.v1alpha.SearchInfo.getDefaultInstance()) { + getSearchInfoBuilder().mergeFrom(value); + } else { + searchInfo_ = value; + } + } else { + searchInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * details related to the event.
+     *
+     * This field should be set for `search` event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchInfo search_info = 12; + */ + public Builder clearSearchInfo() { + bitField0_ = (bitField0_ & ~0x00000800); + searchInfo_ = null; + if (searchInfoBuilder_ != null) { + searchInfoBuilder_.dispose(); + searchInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * details related to the event.
+     *
+     * This field should be set for `search` event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchInfo search_info = 12; + */ + public com.google.cloud.discoveryengine.v1alpha.SearchInfo.Builder getSearchInfoBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return getSearchInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * details related to the event.
+     *
+     * This field should be set for `search` event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchInfo search_info = 12; + */ + public com.google.cloud.discoveryengine.v1alpha.SearchInfoOrBuilder getSearchInfoOrBuilder() { + if (searchInfoBuilder_ != null) { + return searchInfoBuilder_.getMessageOrBuilder(); + } else { + return searchInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.SearchInfo.getDefaultInstance() + : searchInfo_; + } + } + /** + * + * + *
+     * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+     * details related to the event.
+     *
+     * This field should be set for `search` event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchInfo search_info = 12; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchInfo, + com.google.cloud.discoveryengine.v1alpha.SearchInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchInfoOrBuilder> + getSearchInfoFieldBuilder() { + if (searchInfoBuilder_ == null) { + searchInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.SearchInfo, + com.google.cloud.discoveryengine.v1alpha.SearchInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.SearchInfoOrBuilder>( + getSearchInfo(), getParentForChildren(), isClean()); + searchInfo_ = null; + } + return searchInfoBuilder_; + } + + private com.google.cloud.discoveryengine.v1alpha.CompletionInfo completionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.CompletionInfo, + com.google.cloud.discoveryengine.v1alpha.CompletionInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.CompletionInfoOrBuilder> + completionInfoBuilder_; + /** + * + * + *
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery]
+     * 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.discoveryengine.v1alpha.CompletionInfo completion_info = 13; + * + * @return Whether the completionInfo field is set. + */ + public boolean hasCompletionInfo() { + return ((bitField0_ & 0x00001000) != 0); + } + /** + * + * + *
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery]
+     * 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.discoveryengine.v1alpha.CompletionInfo completion_info = 13; + * + * @return The completionInfo. + */ + public com.google.cloud.discoveryengine.v1alpha.CompletionInfo getCompletionInfo() { + if (completionInfoBuilder_ == null) { + return completionInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.CompletionInfo.getDefaultInstance() + : completionInfo_; + } else { + return completionInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery]
+     * 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.discoveryengine.v1alpha.CompletionInfo completion_info = 13; + */ + public Builder setCompletionInfo( + com.google.cloud.discoveryengine.v1alpha.CompletionInfo value) { + if (completionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + completionInfo_ = value; + } else { + completionInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery]
+     * 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.discoveryengine.v1alpha.CompletionInfo completion_info = 13; + */ + public Builder setCompletionInfo( + com.google.cloud.discoveryengine.v1alpha.CompletionInfo.Builder builderForValue) { + if (completionInfoBuilder_ == null) { + completionInfo_ = builderForValue.build(); + } else { + completionInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery]
+     * 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.discoveryengine.v1alpha.CompletionInfo completion_info = 13; + */ + public Builder mergeCompletionInfo( + com.google.cloud.discoveryengine.v1alpha.CompletionInfo value) { + if (completionInfoBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0) + && completionInfo_ != null + && completionInfo_ + != com.google.cloud.discoveryengine.v1alpha.CompletionInfo.getDefaultInstance()) { + getCompletionInfoBuilder().mergeFrom(value); + } else { + completionInfo_ = value; + } + } else { + completionInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery]
+     * 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.discoveryengine.v1alpha.CompletionInfo completion_info = 13; + */ + public Builder clearCompletionInfo() { + bitField0_ = (bitField0_ & ~0x00001000); + completionInfo_ = null; + if (completionInfoBuilder_ != null) { + completionInfoBuilder_.dispose(); + completionInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery]
+     * 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.discoveryengine.v1alpha.CompletionInfo completion_info = 13; + */ + public com.google.cloud.discoveryengine.v1alpha.CompletionInfo.Builder + getCompletionInfoBuilder() { + bitField0_ |= 0x00001000; + onChanged(); + return getCompletionInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery]
+     * 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.discoveryengine.v1alpha.CompletionInfo completion_info = 13; + */ + public com.google.cloud.discoveryengine.v1alpha.CompletionInfoOrBuilder + getCompletionInfoOrBuilder() { + if (completionInfoBuilder_ != null) { + return completionInfoBuilder_.getMessageOrBuilder(); + } else { + return completionInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.CompletionInfo.getDefaultInstance() + : completionInfo_; + } + } + /** + * + * + *
+     * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery]
+     * 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.discoveryengine.v1alpha.CompletionInfo completion_info = 13; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.CompletionInfo, + com.google.cloud.discoveryengine.v1alpha.CompletionInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.CompletionInfoOrBuilder> + getCompletionInfoFieldBuilder() { + if (completionInfoBuilder_ == null) { + completionInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.CompletionInfo, + com.google.cloud.discoveryengine.v1alpha.CompletionInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.CompletionInfoOrBuilder>( + getCompletionInfo(), getParentForChildren(), isClean()); + completionInfo_ = null; + } + return completionInfoBuilder_; + } + + private com.google.cloud.discoveryengine.v1alpha.TransactionInfo transactionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.TransactionInfo, + com.google.cloud.discoveryengine.v1alpha.TransactionInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.TransactionInfoOrBuilder> + transactionInfoBuilder_; + /** + * + * + *
+     * The transaction metadata (if any) associated with this user event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.TransactionInfo transaction_info = 14; + * + * @return Whether the transactionInfo field is set. + */ + public boolean hasTransactionInfo() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * + * + *
+     * The transaction metadata (if any) associated with this user event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.TransactionInfo transaction_info = 14; + * + * @return The transactionInfo. + */ + public com.google.cloud.discoveryengine.v1alpha.TransactionInfo getTransactionInfo() { + if (transactionInfoBuilder_ == null) { + return transactionInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.TransactionInfo.getDefaultInstance() + : transactionInfo_; + } else { + return transactionInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The transaction metadata (if any) associated with this user event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.TransactionInfo transaction_info = 14; + */ + public Builder setTransactionInfo( + com.google.cloud.discoveryengine.v1alpha.TransactionInfo value) { + if (transactionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + transactionInfo_ = value; + } else { + transactionInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * The transaction metadata (if any) associated with this user event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.TransactionInfo transaction_info = 14; + */ + public Builder setTransactionInfo( + com.google.cloud.discoveryengine.v1alpha.TransactionInfo.Builder builderForValue) { + if (transactionInfoBuilder_ == null) { + transactionInfo_ = builderForValue.build(); + } else { + transactionInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * The transaction metadata (if any) associated with this user event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.TransactionInfo transaction_info = 14; + */ + public Builder mergeTransactionInfo( + com.google.cloud.discoveryengine.v1alpha.TransactionInfo value) { + if (transactionInfoBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) + && transactionInfo_ != null + && transactionInfo_ + != com.google.cloud.discoveryengine.v1alpha.TransactionInfo.getDefaultInstance()) { + getTransactionInfoBuilder().mergeFrom(value); + } else { + transactionInfo_ = value; + } + } else { + transactionInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * The transaction metadata (if any) associated with this user event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.TransactionInfo transaction_info = 14; + */ + public Builder clearTransactionInfo() { + bitField0_ = (bitField0_ & ~0x00002000); + transactionInfo_ = null; + if (transactionInfoBuilder_ != null) { + transactionInfoBuilder_.dispose(); + transactionInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The transaction metadata (if any) associated with this user event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.TransactionInfo transaction_info = 14; + */ + public com.google.cloud.discoveryengine.v1alpha.TransactionInfo.Builder + getTransactionInfoBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getTransactionInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The transaction metadata (if any) associated with this user event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.TransactionInfo transaction_info = 14; + */ + public com.google.cloud.discoveryengine.v1alpha.TransactionInfoOrBuilder + getTransactionInfoOrBuilder() { + if (transactionInfoBuilder_ != null) { + return transactionInfoBuilder_.getMessageOrBuilder(); + } else { + return transactionInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.TransactionInfo.getDefaultInstance() + : transactionInfo_; + } + } + /** + * + * + *
+     * The transaction metadata (if any) associated with this user event.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.TransactionInfo transaction_info = 14; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.TransactionInfo, + com.google.cloud.discoveryengine.v1alpha.TransactionInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.TransactionInfoOrBuilder> + getTransactionInfoFieldBuilder() { + if (transactionInfoBuilder_ == null) { + transactionInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.TransactionInfo, + com.google.cloud.discoveryengine.v1alpha.TransactionInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.TransactionInfoOrBuilder>( + getTransactionInfo(), getParentForChildren(), isClean()); + transactionInfo_ = null; + } + return transactionInfoBuilder_; + } + + private com.google.protobuf.LazyStringArrayList tagIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureTagIdsIsMutable() { + if (!tagIds_.isModifiable()) { + tagIds_ = new com.google.protobuf.LazyStringArrayList(tagIds_); + } + bitField0_ |= 0x00004000; + } + /** + * + * + *
+     * 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 on the customer end.
+     * 
+ * + * repeated string tag_ids = 15; + * + * @return A list containing the tagIds. + */ + public com.google.protobuf.ProtocolStringList getTagIdsList() { + tagIds_.makeImmutable(); + return tagIds_; + } + /** + * + * + *
+     * 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 on the customer end.
+     * 
+ * + * repeated string tag_ids = 15; + * + * @return The count of tagIds. + */ + public int getTagIdsCount() { + return tagIds_.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 on the customer end.
+     * 
+ * + * repeated string tag_ids = 15; + * + * @param index The index of the element to return. + * @return The tagIds at the given index. + */ + public java.lang.String getTagIds(int index) { + return tagIds_.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 on the customer end.
+     * 
+ * + * repeated string tag_ids = 15; + * + * @param index The index of the value to return. + * @return The bytes of the tagIds at the given index. + */ + public com.google.protobuf.ByteString getTagIdsBytes(int index) { + return tagIds_.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 on the customer end.
+     * 
+ * + * repeated string tag_ids = 15; + * + * @param index The index to set the value at. + * @param value The tagIds to set. + * @return This builder for chaining. + */ + public Builder setTagIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagIdsIsMutable(); + tagIds_.set(index, value); + bitField0_ |= 0x00004000; + 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 on the customer end.
+     * 
+ * + * repeated string tag_ids = 15; + * + * @param value The tagIds to add. + * @return This builder for chaining. + */ + public Builder addTagIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagIdsIsMutable(); + tagIds_.add(value); + bitField0_ |= 0x00004000; + 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 on the customer end.
+     * 
+ * + * repeated string tag_ids = 15; + * + * @param values The tagIds to add. + * @return This builder for chaining. + */ + public Builder addAllTagIds(java.lang.Iterable values) { + ensureTagIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tagIds_); + bitField0_ |= 0x00004000; + 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 on the customer end.
+     * 
+ * + * repeated string tag_ids = 15; + * + * @return This builder for chaining. + */ + public Builder clearTagIds() { + tagIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00004000); + ; + 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 on the customer end.
+     * 
+ * + * repeated string tag_ids = 15; + * + * @param value The bytes of the tagIds to add. + * @return This builder for chaining. + */ + public Builder addTagIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTagIdsIsMutable(); + tagIds_.add(value); + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList promotionIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensurePromotionIdsIsMutable() { + if (!promotionIds_.isModifiable()) { + promotionIds_ = new com.google.protobuf.LazyStringArrayList(promotionIds_); + } + bitField0_ |= 0x00008000; + } + /** + * + * + *
+     * The promotion IDs if this is an event associated with promotions.
+     * Currently, this field is restricted to at most one ID.
+     * 
+ * + * repeated string promotion_ids = 16; + * + * @return A list containing the promotionIds. + */ + public com.google.protobuf.ProtocolStringList getPromotionIdsList() { + promotionIds_.makeImmutable(); + return promotionIds_; + } + /** + * + * + *
+     * The promotion IDs if this is an event associated with promotions.
+     * Currently, this field is restricted to at most one ID.
+     * 
+ * + * repeated string promotion_ids = 16; + * + * @return The count of promotionIds. + */ + public int getPromotionIdsCount() { + return promotionIds_.size(); + } + /** + * + * + *
+     * The promotion IDs if this is an event associated with promotions.
+     * Currently, this field is restricted to at most one ID.
+     * 
+ * + * repeated string promotion_ids = 16; + * + * @param index The index of the element to return. + * @return The promotionIds at the given index. + */ + public java.lang.String getPromotionIds(int index) { + return promotionIds_.get(index); + } + /** + * + * + *
+     * The promotion IDs if this is an event associated with promotions.
+     * Currently, this field is restricted to at most one ID.
+     * 
+ * + * repeated string promotion_ids = 16; + * + * @param index The index of the value to return. + * @return The bytes of the promotionIds at the given index. + */ + public com.google.protobuf.ByteString getPromotionIdsBytes(int index) { + return promotionIds_.getByteString(index); + } + /** + * + * + *
+     * The promotion IDs if this is an event associated with promotions.
+     * Currently, this field is restricted to at most one ID.
+     * 
+ * + * repeated string promotion_ids = 16; + * + * @param index The index to set the value at. + * @param value The promotionIds to set. + * @return This builder for chaining. + */ + public Builder setPromotionIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePromotionIdsIsMutable(); + promotionIds_.set(index, value); + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * The promotion IDs if this is an event associated with promotions.
+     * Currently, this field is restricted to at most one ID.
+     * 
+ * + * repeated string promotion_ids = 16; + * + * @param value The promotionIds to add. + * @return This builder for chaining. + */ + public Builder addPromotionIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePromotionIdsIsMutable(); + promotionIds_.add(value); + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * The promotion IDs if this is an event associated with promotions.
+     * Currently, this field is restricted to at most one ID.
+     * 
+ * + * repeated string promotion_ids = 16; + * + * @param values The promotionIds to add. + * @return This builder for chaining. + */ + public Builder addAllPromotionIds(java.lang.Iterable values) { + ensurePromotionIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, promotionIds_); + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * The promotion IDs if this is an event associated with promotions.
+     * Currently, this field is restricted to at most one ID.
+     * 
+ * + * repeated string promotion_ids = 16; + * + * @return This builder for chaining. + */ + public Builder clearPromotionIds() { + promotionIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00008000); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * The promotion IDs if this is an event associated with promotions.
+     * Currently, this field is restricted to at most one ID.
+     * 
+ * + * repeated string promotion_ids = 16; + * + * @param value The bytes of the promotionIds to add. + * @return This builder for chaining. + */ + public Builder addPromotionIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePromotionIdsIsMutable(); + promotionIds_.add(value); + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.discoveryengine.v1alpha.CustomAttribute> + attributes_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.CustomAttribute> + internalGetMutableAttributes() { + if (attributes_ == null) { + attributes_ = + com.google.protobuf.MapField.newMapField(AttributesDefaultEntryHolder.defaultEntry); + } + if (!attributes_.isMutable()) { + attributes_ = attributes_.copy(); + } + bitField0_ |= 0x00010000; + onChanged(); + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * + * + *
+     * Extra user event features to include in the recommendation model.
+     * These attributes must NOT contain data that needs to be parsed or processed
+     * further, e.g. JSON or other encodings.
+     *
+     * 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 Discovery Engine 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.discoveryengine.v1alpha.CustomAttribute> attributes = 17; + * + */ + @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.
+     * These attributes must NOT contain data that needs to be parsed or processed
+     * further, e.g. JSON or other encodings.
+     *
+     * 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 Discovery Engine 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.discoveryengine.v1alpha.CustomAttribute> attributes = 17; + * + */ + @java.lang.Override + public java.util.Map + getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * + * + *
+     * Extra user event features to include in the recommendation model.
+     * These attributes must NOT contain data that needs to be parsed or processed
+     * further, e.g. JSON or other encodings.
+     *
+     * 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 Discovery Engine 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.discoveryengine.v1alpha.CustomAttribute> attributes = 17; + * + */ + @java.lang.Override + public /* nullable */ com.google.cloud.discoveryengine.v1alpha.CustomAttribute + getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.discoveryengine.v1alpha.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.
+     * These attributes must NOT contain data that needs to be parsed or processed
+     * further, e.g. JSON or other encodings.
+     *
+     * 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 Discovery Engine 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.discoveryengine.v1alpha.CustomAttribute> attributes = 17; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.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() { + bitField0_ = (bitField0_ & ~0x00010000); + internalGetMutableAttributes().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Extra user event features to include in the recommendation model.
+     * These attributes must NOT contain data that needs to be parsed or processed
+     * further, e.g. JSON or other encodings.
+     *
+     * 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 Discovery Engine 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.discoveryengine.v1alpha.CustomAttribute> attributes = 17; + * + */ + 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() { + bitField0_ |= 0x00010000; + return internalGetMutableAttributes().getMutableMap(); + } + /** + * + * + *
+     * Extra user event features to include in the recommendation model.
+     * These attributes must NOT contain data that needs to be parsed or processed
+     * further, e.g. JSON or other encodings.
+     *
+     * 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 Discovery Engine 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.discoveryengine.v1alpha.CustomAttribute> attributes = 17; + * + */ + public Builder putAttributes( + java.lang.String key, com.google.cloud.discoveryengine.v1alpha.CustomAttribute value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAttributes().getMutableMap().put(key, value); + bitField0_ |= 0x00010000; + return this; + } + /** + * + * + *
+     * Extra user event features to include in the recommendation model.
+     * These attributes must NOT contain data that needs to be parsed or processed
+     * further, e.g. JSON or other encodings.
+     *
+     * 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 Discovery Engine 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.discoveryengine.v1alpha.CustomAttribute> attributes = 17; + * + */ + public Builder putAllAttributes( + java.util.Map + values) { + internalGetMutableAttributes().getMutableMap().putAll(values); + bitField0_ |= 0x00010000; + return this; + } + + private com.google.cloud.discoveryengine.v1alpha.MediaInfo mediaInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.MediaInfo, + com.google.cloud.discoveryengine.v1alpha.MediaInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.MediaInfoOrBuilder> + mediaInfoBuilder_; + /** + * + * + *
+     * Media-specific info.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.MediaInfo media_info = 18; + * + * @return Whether the mediaInfo field is set. + */ + public boolean hasMediaInfo() { + return ((bitField0_ & 0x00020000) != 0); + } + /** + * + * + *
+     * Media-specific info.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.MediaInfo media_info = 18; + * + * @return The mediaInfo. + */ + public com.google.cloud.discoveryengine.v1alpha.MediaInfo getMediaInfo() { + if (mediaInfoBuilder_ == null) { + return mediaInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.MediaInfo.getDefaultInstance() + : mediaInfo_; + } else { + return mediaInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Media-specific info.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.MediaInfo media_info = 18; + */ + public Builder setMediaInfo(com.google.cloud.discoveryengine.v1alpha.MediaInfo value) { + if (mediaInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mediaInfo_ = value; + } else { + mediaInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * Media-specific info.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.MediaInfo media_info = 18; + */ + public Builder setMediaInfo( + com.google.cloud.discoveryengine.v1alpha.MediaInfo.Builder builderForValue) { + if (mediaInfoBuilder_ == null) { + mediaInfo_ = builderForValue.build(); + } else { + mediaInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * Media-specific info.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.MediaInfo media_info = 18; + */ + public Builder mergeMediaInfo(com.google.cloud.discoveryengine.v1alpha.MediaInfo value) { + if (mediaInfoBuilder_ == null) { + if (((bitField0_ & 0x00020000) != 0) + && mediaInfo_ != null + && mediaInfo_ + != com.google.cloud.discoveryengine.v1alpha.MediaInfo.getDefaultInstance()) { + getMediaInfoBuilder().mergeFrom(value); + } else { + mediaInfo_ = value; + } + } else { + mediaInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * Media-specific info.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.MediaInfo media_info = 18; + */ + public Builder clearMediaInfo() { + bitField0_ = (bitField0_ & ~0x00020000); + mediaInfo_ = null; + if (mediaInfoBuilder_ != null) { + mediaInfoBuilder_.dispose(); + mediaInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Media-specific info.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.MediaInfo media_info = 18; + */ + public com.google.cloud.discoveryengine.v1alpha.MediaInfo.Builder getMediaInfoBuilder() { + bitField0_ |= 0x00020000; + onChanged(); + return getMediaInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Media-specific info.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.MediaInfo media_info = 18; + */ + public com.google.cloud.discoveryengine.v1alpha.MediaInfoOrBuilder getMediaInfoOrBuilder() { + if (mediaInfoBuilder_ != null) { + return mediaInfoBuilder_.getMessageOrBuilder(); + } else { + return mediaInfo_ == null + ? com.google.cloud.discoveryengine.v1alpha.MediaInfo.getDefaultInstance() + : mediaInfo_; + } + } + /** + * + * + *
+     * Media-specific info.
+     * 
+ * + * .google.cloud.discoveryengine.v1alpha.MediaInfo media_info = 18; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.MediaInfo, + com.google.cloud.discoveryengine.v1alpha.MediaInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.MediaInfoOrBuilder> + getMediaInfoFieldBuilder() { + if (mediaInfoBuilder_ == null) { + mediaInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.MediaInfo, + com.google.cloud.discoveryengine.v1alpha.MediaInfo.Builder, + com.google.cloud.discoveryengine.v1alpha.MediaInfoOrBuilder>( + getMediaInfo(), getParentForChildren(), isClean()); + mediaInfo_ = null; + } + return mediaInfoBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1alpha.UserEvent) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.UserEvent) + private static final com.google.cloud.discoveryengine.v1alpha.UserEvent DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.UserEvent(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UserEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventOrBuilder.java new file mode 100644 index 000000000000..17beafabe965 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventOrBuilder.java @@ -0,0 +1,1085 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/user_event.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface UserEventOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.UserEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. User event type. Allowed values are:
+   *
+   * Generic values:
+   *
+   * * `search`: Search for Documents.
+   * * `view-item`: Detailed page view of a Document.
+   * * `view-item-list`: View of a panel or ordered list of Documents.
+   * * `view-home-page`: View of the home page.
+   * * `view-category-page`: View of a category page, e.g. Home > Men > Jeans
+   *
+   * Retail-related values:
+   *
+   * * `add-to-cart`: Add an item(s) to cart, e.g. in Retail online shopping
+   * * `purchase`: Purchase an item(s)
+   *
+   * Media-related values:
+   *
+   * * `media-play`: Start/resume watching a video, playing a song, etc.
+   * * `media-complete`: Finished or stopped midway through a video, song, etc.
+   * 
+ * + * string event_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The eventType. + */ + java.lang.String getEventType(); + /** + * + * + *
+   * Required. User event type. Allowed values are:
+   *
+   * Generic values:
+   *
+   * * `search`: Search for Documents.
+   * * `view-item`: Detailed page view of a Document.
+   * * `view-item-list`: View of a panel or ordered list of Documents.
+   * * `view-home-page`: View of the home page.
+   * * `view-category-page`: View of a category page, e.g. Home > Men > Jeans
+   *
+   * Retail-related values:
+   *
+   * * `add-to-cart`: Add an item(s) to cart, e.g. in Retail online shopping
+   * * `purchase`: Purchase an item(s)
+   *
+   * Media-related values:
+   *
+   * * `media-play`: Start/resume watching a video, playing a song, etc.
+   * * `media-complete`: Finished or stopped midway through a video, song, etc.
+   * 
+ * + * 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.
+   *
+   * Do not set the field to the same fixed ID for different users. This mixes
+   * the event history of those users together, which results in degraded model
+   * quality.
+   *
+   * 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
+   * Analytics [Client
+   * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+   * for this field.
+   * 
+ * + * string user_pseudo_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The userPseudoId. + */ + java.lang.String getUserPseudoId(); + /** + * + * + *
+   * 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.
+   *
+   * Do not set the field to the same fixed ID for different users. This mixes
+   * the event history of those users together, which results in degraded model
+   * quality.
+   *
+   * 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
+   * Analytics [Client
+   * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
+   * for this field.
+   * 
+ * + * string user_pseudo_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for userPseudoId. + */ + com.google.protobuf.ByteString getUserPseudoIdBytes(); + + /** + * + * + *
+   * Only required for
+   * [UserEventService.ImportUserEvents][google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEventService.ImportUserEvents]
+   * method. Timestamp of when the user event happened.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getEventTimeOrBuilder(); + + /** + * + * + *
+   * Information about the end user.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 4; + * + * @return Whether the userInfo field is set. + */ + boolean hasUserInfo(); + /** + * + * + *
+   * Information about the end user.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 4; + * + * @return The userInfo. + */ + com.google.cloud.discoveryengine.v1alpha.UserInfo getUserInfo(); + /** + * + * + *
+   * Information about the end user.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.UserInfo user_info = 4; + */ + com.google.cloud.discoveryengine.v1alpha.UserInfoOrBuilder getUserInfoOrBuilder(); + + /** + * + * + *
+   * Should set to true if the request is made directly from the end user, in
+   * which case the
+   * [UserEvent.user_info.user_agent][google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEventService.CollectUserEvent].
+   * 
+ * + * bool direct_user_request = 5; + * + * @return The directUserRequest. + */ + boolean getDirectUserRequest(); + + /** + * + * + *
+   * 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 session_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
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * as prefix.
+   * 
+ * + * string session_id = 6; + * + * @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 session_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
+   * [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
+   * as prefix.
+   * 
+ * + * string session_id = 6; + * + * @return The bytes for sessionId. + */ + com.google.protobuf.ByteString getSessionIdBytes(); + + /** + * + * + *
+   * Page metadata such as categories and other critical information for certain
+   * event types such as `view-category-page`.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.PageInfo page_info = 7; + * + * @return Whether the pageInfo field is set. + */ + boolean hasPageInfo(); + /** + * + * + *
+   * Page metadata such as categories and other critical information for certain
+   * event types such as `view-category-page`.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.PageInfo page_info = 7; + * + * @return The pageInfo. + */ + com.google.cloud.discoveryengine.v1alpha.PageInfo getPageInfo(); + /** + * + * + *
+   * Page metadata such as categories and other critical information for certain
+   * event types such as `view-category-page`.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.PageInfo page_info = 7; + */ + com.google.cloud.discoveryengine.v1alpha.PageInfoOrBuilder getPageInfoOrBuilder(); + + /** + * + * + *
+   * Token to attribute an API response to user action(s) to trigger the event.
+   *
+   * Highly recommended for user events that are the result of
+   * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+   * This field enables accurate attribution of recommendation model
+   * performance.
+   *
+   * The value must be one of:
+   *
+   * * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token] for events that are the result of
+   * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+   * * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1alpha.SearchResponse.attribution_token] for events that are the result of
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+   *
+   * This token enables us to accurately attribute page view or conversion
+   * completion 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
+   * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token]
+   * as a URL parameter to product K's page. When recording events on product
+   * K's page, log the
+   * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token]
+   * to this field.
+   * 
+ * + * string attribution_token = 8; + * + * @return The attributionToken. + */ + java.lang.String getAttributionToken(); + /** + * + * + *
+   * Token to attribute an API response to user action(s) to trigger the event.
+   *
+   * Highly recommended for user events that are the result of
+   * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+   * This field enables accurate attribution of recommendation model
+   * performance.
+   *
+   * The value must be one of:
+   *
+   * * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token] for events that are the result of
+   * [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
+   * * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1alpha.SearchResponse.attribution_token] for events that are the result of
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
+   *
+   * This token enables us to accurately attribute page view or conversion
+   * completion 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
+   * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token]
+   * as a URL parameter to product K's page. When recording events on product
+   * K's page, log the
+   * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token]
+   * to this field.
+   * 
+ * + * string attribution_token = 8; + * + * @return The bytes for attributionToken. + */ + com.google.protobuf.ByteString getAttributionTokenBytes(); + + /** + * + * + *
+   * The filter syntax consists of an expression language for constructing a
+   * predicate from one or more fields of the documents being filtered.
+   *
+   * One example is for `search` events, the associated
+   * [SearchRequest][google.cloud.discoveryengine.v1alpha.SearchRequest] may
+   * contain a filter expression in
+   * [SearchRequest.filter][google.cloud.discoveryengine.v1alpha.SearchRequest.filter]
+   * conforming to https://google.aip.dev/160#filtering.
+   *
+   * Similarly, for `view-item-list` events that are generated from a
+   * [RecommendationService.RecommendRequest][], this field may be populated
+   * directly from [RecommendationService.RecommendRequest.filter][] conforming
+   * to https://google.aip.dev/160#filtering.
+   *
+   * 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 = 9; + * + * @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 documents being filtered.
+   *
+   * One example is for `search` events, the associated
+   * [SearchRequest][google.cloud.discoveryengine.v1alpha.SearchRequest] may
+   * contain a filter expression in
+   * [SearchRequest.filter][google.cloud.discoveryengine.v1alpha.SearchRequest.filter]
+   * conforming to https://google.aip.dev/160#filtering.
+   *
+   * Similarly, for `view-item-list` events that are generated from a
+   * [RecommendationService.RecommendRequest][], this field may be populated
+   * directly from [RecommendationService.RecommendRequest.filter][] conforming
+   * to https://google.aip.dev/160#filtering.
+   *
+   * 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 = 9; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+   * associated with this user event.
+   *
+   * This field is optional except for the following event types:
+   *
+   * * `view-item`
+   * * `add-to-cart`
+   * * `purchase`
+   * * `media-play`
+   * * `media-complete`
+   *
+   * In a `search` event, this field represents the documents 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
+   * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+   * is desired.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + java.util.List getDocumentsList(); + /** + * + * + *
+   * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+   * associated with this user event.
+   *
+   * This field is optional except for the following event types:
+   *
+   * * `view-item`
+   * * `add-to-cart`
+   * * `purchase`
+   * * `media-play`
+   * * `media-complete`
+   *
+   * In a `search` event, this field represents the documents 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
+   * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+   * is desired.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + com.google.cloud.discoveryengine.v1alpha.DocumentInfo getDocuments(int index); + /** + * + * + *
+   * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+   * associated with this user event.
+   *
+   * This field is optional except for the following event types:
+   *
+   * * `view-item`
+   * * `add-to-cart`
+   * * `purchase`
+   * * `media-play`
+   * * `media-complete`
+   *
+   * In a `search` event, this field represents the documents 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
+   * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+   * is desired.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + int getDocumentsCount(); + /** + * + * + *
+   * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+   * associated with this user event.
+   *
+   * This field is optional except for the following event types:
+   *
+   * * `view-item`
+   * * `add-to-cart`
+   * * `purchase`
+   * * `media-play`
+   * * `media-complete`
+   *
+   * In a `search` event, this field represents the documents 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
+   * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+   * is desired.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + java.util.List + getDocumentsOrBuilderList(); + /** + * + * + *
+   * List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
+   * associated with this user event.
+   *
+   * This field is optional except for the following event types:
+   *
+   * * `view-item`
+   * * `add-to-cart`
+   * * `purchase`
+   * * `media-play`
+   * * `media-complete`
+   *
+   * In a `search` event, this field represents the documents 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
+   * [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
+   * is desired.
+   * 
+ * + * repeated .google.cloud.discoveryengine.v1alpha.DocumentInfo documents = 10; + */ + com.google.cloud.discoveryengine.v1alpha.DocumentInfoOrBuilder getDocumentsOrBuilder(int index); + + /** + * + * + *
+   * Panel metadata associated with this user event.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.PanelInfo panel = 11; + * + * @return Whether the panel field is set. + */ + boolean hasPanel(); + /** + * + * + *
+   * Panel metadata associated with this user event.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.PanelInfo panel = 11; + * + * @return The panel. + */ + com.google.cloud.discoveryengine.v1alpha.PanelInfo getPanel(); + /** + * + * + *
+   * Panel metadata associated with this user event.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.PanelInfo panel = 11; + */ + com.google.cloud.discoveryengine.v1alpha.PanelInfoOrBuilder getPanelOrBuilder(); + + /** + * + * + *
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+   * details related to the event.
+   *
+   * This field should be set for `search` event.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchInfo search_info = 12; + * + * @return Whether the searchInfo field is set. + */ + boolean hasSearchInfo(); + /** + * + * + *
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+   * details related to the event.
+   *
+   * This field should be set for `search` event.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchInfo search_info = 12; + * + * @return The searchInfo. + */ + com.google.cloud.discoveryengine.v1alpha.SearchInfo getSearchInfo(); + /** + * + * + *
+   * [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
+   * details related to the event.
+   *
+   * This field should be set for `search` event.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.SearchInfo search_info = 12; + */ + com.google.cloud.discoveryengine.v1alpha.SearchInfoOrBuilder getSearchInfoOrBuilder(); + + /** + * + * + *
+   * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery]
+   * 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.discoveryengine.v1alpha.CompletionInfo completion_info = 13; + * + * @return Whether the completionInfo field is set. + */ + boolean hasCompletionInfo(); + /** + * + * + *
+   * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery]
+   * 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.discoveryengine.v1alpha.CompletionInfo completion_info = 13; + * + * @return The completionInfo. + */ + com.google.cloud.discoveryengine.v1alpha.CompletionInfo getCompletionInfo(); + /** + * + * + *
+   * [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery]
+   * 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.discoveryengine.v1alpha.CompletionInfo completion_info = 13; + */ + com.google.cloud.discoveryengine.v1alpha.CompletionInfoOrBuilder getCompletionInfoOrBuilder(); + + /** + * + * + *
+   * The transaction metadata (if any) associated with this user event.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.TransactionInfo transaction_info = 14; + * + * @return Whether the transactionInfo field is set. + */ + boolean hasTransactionInfo(); + /** + * + * + *
+   * The transaction metadata (if any) associated with this user event.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.TransactionInfo transaction_info = 14; + * + * @return The transactionInfo. + */ + com.google.cloud.discoveryengine.v1alpha.TransactionInfo getTransactionInfo(); + /** + * + * + *
+   * The transaction metadata (if any) associated with this user event.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.TransactionInfo transaction_info = 14; + */ + com.google.cloud.discoveryengine.v1alpha.TransactionInfoOrBuilder getTransactionInfoOrBuilder(); + + /** + * + * + *
+   * 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 on the customer end.
+   * 
+ * + * repeated string tag_ids = 15; + * + * @return A list containing the tagIds. + */ + java.util.List getTagIdsList(); + /** + * + * + *
+   * 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 on the customer end.
+   * 
+ * + * repeated string tag_ids = 15; + * + * @return The count of tagIds. + */ + int getTagIdsCount(); + /** + * + * + *
+   * 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 on the customer end.
+   * 
+ * + * repeated string tag_ids = 15; + * + * @param index The index of the element to return. + * @return The tagIds at the given index. + */ + java.lang.String getTagIds(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 on the customer end.
+   * 
+ * + * repeated string tag_ids = 15; + * + * @param index The index of the value to return. + * @return The bytes of the tagIds at the given index. + */ + com.google.protobuf.ByteString getTagIdsBytes(int index); + + /** + * + * + *
+   * The promotion IDs if this is an event associated with promotions.
+   * Currently, this field is restricted to at most one ID.
+   * 
+ * + * repeated string promotion_ids = 16; + * + * @return A list containing the promotionIds. + */ + java.util.List getPromotionIdsList(); + /** + * + * + *
+   * The promotion IDs if this is an event associated with promotions.
+   * Currently, this field is restricted to at most one ID.
+   * 
+ * + * repeated string promotion_ids = 16; + * + * @return The count of promotionIds. + */ + int getPromotionIdsCount(); + /** + * + * + *
+   * The promotion IDs if this is an event associated with promotions.
+   * Currently, this field is restricted to at most one ID.
+   * 
+ * + * repeated string promotion_ids = 16; + * + * @param index The index of the element to return. + * @return The promotionIds at the given index. + */ + java.lang.String getPromotionIds(int index); + /** + * + * + *
+   * The promotion IDs if this is an event associated with promotions.
+   * Currently, this field is restricted to at most one ID.
+   * 
+ * + * repeated string promotion_ids = 16; + * + * @param index The index of the value to return. + * @return The bytes of the promotionIds at the given index. + */ + com.google.protobuf.ByteString getPromotionIdsBytes(int index); + + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * These attributes must NOT contain data that needs to be parsed or processed
+   * further, e.g. JSON or other encodings.
+   *
+   * 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 Discovery Engine 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.discoveryengine.v1alpha.CustomAttribute> attributes = 17; + * + */ + int getAttributesCount(); + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * These attributes must NOT contain data that needs to be parsed or processed
+   * further, e.g. JSON or other encodings.
+   *
+   * 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 Discovery Engine 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.discoveryengine.v1alpha.CustomAttribute> attributes = 17; + * + */ + 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.
+   * These attributes must NOT contain data that needs to be parsed or processed
+   * further, e.g. JSON or other encodings.
+   *
+   * 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 Discovery Engine 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.discoveryengine.v1alpha.CustomAttribute> attributes = 17; + * + */ + java.util.Map + getAttributesMap(); + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * These attributes must NOT contain data that needs to be parsed or processed
+   * further, e.g. JSON or other encodings.
+   *
+   * 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 Discovery Engine 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.discoveryengine.v1alpha.CustomAttribute> attributes = 17; + * + */ + /* nullable */ + com.google.cloud.discoveryengine.v1alpha.CustomAttribute getAttributesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.discoveryengine.v1alpha.CustomAttribute defaultValue); + /** + * + * + *
+   * Extra user event features to include in the recommendation model.
+   * These attributes must NOT contain data that needs to be parsed or processed
+   * further, e.g. JSON or other encodings.
+   *
+   * 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 Discovery Engine 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.discoveryengine.v1alpha.CustomAttribute> attributes = 17; + * + */ + com.google.cloud.discoveryengine.v1alpha.CustomAttribute getAttributesOrThrow( + java.lang.String key); + + /** + * + * + *
+   * Media-specific info.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.MediaInfo media_info = 18; + * + * @return Whether the mediaInfo field is set. + */ + boolean hasMediaInfo(); + /** + * + * + *
+   * Media-specific info.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.MediaInfo media_info = 18; + * + * @return The mediaInfo. + */ + com.google.cloud.discoveryengine.v1alpha.MediaInfo getMediaInfo(); + /** + * + * + *
+   * Media-specific info.
+   * 
+ * + * .google.cloud.discoveryengine.v1alpha.MediaInfo media_info = 18; + */ + com.google.cloud.discoveryengine.v1alpha.MediaInfoOrBuilder getMediaInfoOrBuilder(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventProto.java new file mode 100644 index 000000000000..ba1cc4c6a71d --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventProto.java @@ -0,0 +1,268 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/user_event.proto + +package com.google.cloud.discoveryengine.v1alpha; + +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_discoveryengine_v1alpha_UserEvent_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_UserEvent_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_UserEvent_AttributesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_UserEvent_AttributesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_PageInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_PageInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_SearchInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_SearchInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_CompletionInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_CompletionInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_TransactionInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_TransactionInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_DocumentInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_DocumentInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_PanelInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_PanelInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_MediaInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_MediaInfo_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n5google/cloud/discoveryengine/v1alpha/u" + + "ser_event.proto\022$google.cloud.discoverye" + + "ngine.v1alpha\032\037google/api/field_behavior" + + ".proto\032\031google/api/resource.proto\0321googl" + + "e/cloud/discoveryengine/v1alpha/common.p" + + "roto\032\036google/protobuf/duration.proto\032\037go" + + "ogle/protobuf/timestamp.proto\"\357\007\n\tUserEv" + + "ent\022\030\n\nevent_type\030\001 \001(\tB\004\342A\001\002\022\034\n\016user_ps" + + "eudo_id\030\002 \001(\tB\004\342A\001\002\022.\n\nevent_time\030\003 \001(\0132" + + "\032.google.protobuf.Timestamp\022A\n\tuser_info" + + "\030\004 \001(\0132..google.cloud.discoveryengine.v1" + + "alpha.UserInfo\022\033\n\023direct_user_request\030\005 " + + "\001(\010\022\022\n\nsession_id\030\006 \001(\t\022A\n\tpage_info\030\007 \001" + + "(\0132..google.cloud.discoveryengine.v1alph" + + "a.PageInfo\022\031\n\021attribution_token\030\010 \001(\t\022\016\n" + + "\006filter\030\t \001(\t\022E\n\tdocuments\030\n \003(\01322.googl" + + "e.cloud.discoveryengine.v1alpha.Document" + + "Info\022>\n\005panel\030\013 \001(\0132/.google.cloud.disco" + + "veryengine.v1alpha.PanelInfo\022E\n\013search_i" + + "nfo\030\014 \001(\01320.google.cloud.discoveryengine" + + ".v1alpha.SearchInfo\022M\n\017completion_info\030\r" + + " \001(\01324.google.cloud.discoveryengine.v1al" + + "pha.CompletionInfo\022O\n\020transaction_info\030\016" + + " \001(\01325.google.cloud.discoveryengine.v1al" + + "pha.TransactionInfo\022\017\n\007tag_ids\030\017 \003(\t\022\025\n\r" + + "promotion_ids\030\020 \003(\t\022S\n\nattributes\030\021 \003(\0132" + + "?.google.cloud.discoveryengine.v1alpha.U" + + "serEvent.AttributesEntry\022C\n\nmedia_info\030\022" + + " \001(\0132/.google.cloud.discoveryengine.v1al" + + "pha.MediaInfo\032h\n\017AttributesEntry\022\013\n\003key\030" + + "\001 \001(\t\022D\n\005value\030\002 \001(\01325.google.cloud.disc" + + "overyengine.v1alpha.CustomAttribute:\0028\001\"" + + "Y\n\010PageInfo\022\023\n\013pageview_id\030\001 \001(\t\022\025\n\rpage" + + "_category\030\002 \001(\t\022\013\n\003uri\030\003 \001(\t\022\024\n\014referrer" + + "_uri\030\004 \001(\t\"T\n\nSearchInfo\022\024\n\014search_query" + + "\030\001 \001(\t\022\020\n\010order_by\030\002 \001(\t\022\023\n\006offset\030\003 \001(\005" + + "H\000\210\001\001B\t\n\007_offset\"H\n\016CompletionInfo\022\033\n\023se" + + "lected_suggestion\030\001 \001(\t\022\031\n\021selected_posi" + + "tion\030\002 \001(\005\"\313\001\n\017TransactionInfo\022\030\n\005value\030" + + "\001 \001(\002B\004\342A\001\002H\000\210\001\001\022\026\n\010currency\030\002 \001(\tB\004\342A\001\002" + + "\022\026\n\016transaction_id\030\003 \001(\t\022\020\n\003tax\030\004 \001(\002H\001\210" + + "\001\001\022\021\n\004cost\030\005 \001(\002H\002\210\001\001\022\033\n\016discount_value\030" + + "\006 \001(\002H\003\210\001\001B\010\n\006_valueB\006\n\004_taxB\007\n\005_costB\021\n" + + "\017_discount_value\"\273\001\n\014DocumentInfo\022\014\n\002id\030" + + "\001 \001(\tH\000\022<\n\004name\030\002 \001(\tB,\372A)\n\'discoveryeng" + + "ine.googleapis.com/DocumentH\000\022\r\n\003uri\030\006 \001" + + "(\tH\000\022\025\n\010quantity\030\003 \001(\005H\001\210\001\001\022\025\n\rpromotion" + + "_ids\030\004 \003(\tB\025\n\023document_descriptorB\013\n\t_qu" + + "antity\"\225\001\n\tPanelInfo\022\026\n\010panel_id\030\002 \001(\tB\004" + + "\342A\001\002\022\024\n\014display_name\030\003 \001(\t\022\033\n\016panel_posi" + + "tion\030\004 \001(\005H\000\210\001\001\022\031\n\014total_panels\030\005 \001(\005H\001\210" + + "\001\001B\021\n\017_panel_positionB\017\n\r_total_panels\"\215" + + "\001\n\tMediaInfo\022:\n\027media_progress_duration\030" + + "\001 \001(\0132\031.google.protobuf.Duration\022&\n\031medi" + + "a_progress_percentage\030\002 \001(\002H\000\210\001\001B\034\n\032_med" + + "ia_progress_percentageB\232\002\n(com.google.cl" + + "oud.discoveryengine.v1alphaB\016UserEventPr" + + "otoP\001ZRcloud.google.com/go/discoveryengi" + + "ne/apiv1alpha/discoveryenginepb;discover" + + "yenginepb\242\002\017DISCOVERYENGINE\252\002$Google.Clo" + + "ud.DiscoveryEngine.V1Alpha\312\002$Google\\Clou" + + "d\\DiscoveryEngine\\V1alpha\352\002\'Google::Clou" + + "d::DiscoveryEngine::V1alphab\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.discoveryengine.v1alpha.CommonProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_discoveryengine_v1alpha_UserEvent_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_discoveryengine_v1alpha_UserEvent_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_UserEvent_descriptor, + new java.lang.String[] { + "EventType", + "UserPseudoId", + "EventTime", + "UserInfo", + "DirectUserRequest", + "SessionId", + "PageInfo", + "AttributionToken", + "Filter", + "Documents", + "Panel", + "SearchInfo", + "CompletionInfo", + "TransactionInfo", + "TagIds", + "PromotionIds", + "Attributes", + "MediaInfo", + }); + internal_static_google_cloud_discoveryengine_v1alpha_UserEvent_AttributesEntry_descriptor = + internal_static_google_cloud_discoveryengine_v1alpha_UserEvent_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_discoveryengine_v1alpha_UserEvent_AttributesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_UserEvent_AttributesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_discoveryengine_v1alpha_PageInfo_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_discoveryengine_v1alpha_PageInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_PageInfo_descriptor, + new java.lang.String[] { + "PageviewId", "PageCategory", "Uri", "ReferrerUri", + }); + internal_static_google_cloud_discoveryengine_v1alpha_SearchInfo_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_discoveryengine_v1alpha_SearchInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_SearchInfo_descriptor, + new java.lang.String[] { + "SearchQuery", "OrderBy", "Offset", "Offset", + }); + internal_static_google_cloud_discoveryengine_v1alpha_CompletionInfo_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_discoveryengine_v1alpha_CompletionInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_CompletionInfo_descriptor, + new java.lang.String[] { + "SelectedSuggestion", "SelectedPosition", + }); + internal_static_google_cloud_discoveryengine_v1alpha_TransactionInfo_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_discoveryengine_v1alpha_TransactionInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_TransactionInfo_descriptor, + new java.lang.String[] { + "Value", + "Currency", + "TransactionId", + "Tax", + "Cost", + "DiscountValue", + "Value", + "Tax", + "Cost", + "DiscountValue", + }); + internal_static_google_cloud_discoveryengine_v1alpha_DocumentInfo_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_discoveryengine_v1alpha_DocumentInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_DocumentInfo_descriptor, + new java.lang.String[] { + "Id", "Name", "Uri", "Quantity", "PromotionIds", "DocumentDescriptor", "Quantity", + }); + internal_static_google_cloud_discoveryengine_v1alpha_PanelInfo_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_discoveryengine_v1alpha_PanelInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_PanelInfo_descriptor, + new java.lang.String[] { + "PanelId", + "DisplayName", + "PanelPosition", + "TotalPanels", + "PanelPosition", + "TotalPanels", + }); + internal_static_google_cloud_discoveryengine_v1alpha_MediaInfo_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_discoveryengine_v1alpha_MediaInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_discoveryengine_v1alpha_MediaInfo_descriptor, + new java.lang.String[] { + "MediaProgressDuration", "MediaProgressPercentage", "MediaProgressPercentage", + }); + 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.discoveryengine.v1alpha.CommonProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceProto.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceProto.java new file mode 100644 index 000000000000..9cb03a649b29 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserEventServiceProto.java @@ -0,0 +1,167 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/user_event_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +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_discoveryengine_v1alpha_WriteUserEventRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_WriteUserEventRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_discoveryengine_v1alpha_CollectUserEventRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_discoveryengine_v1alpha_CollectUserEventRequest_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/discoveryengine/v1alpha/u" + + "ser_event_service.proto\022$google.cloud.di" + + "scoveryengine.v1alpha\032\034google/api/annota" + + "tions.proto\032\027google/api/client.proto\032\037go" + + "ogle/api/field_behavior.proto\032\031google/ap" + + "i/httpbody.proto\032\031google/api/resource.pr" + + "oto\0328google/cloud/discoveryengine/v1alph" + + "a/import_config.proto\0327google/cloud/disc" + + "overyengine/v1alpha/purge_config.proto\0325" + + "google/cloud/discoveryengine/v1alpha/use" + + "r_event.proto\032#google/longrunning/operat" + + "ions.proto\"\271\001\n\025WriteUserEventRequest\022A\n\006" + + "parent\030\001 \001(\tB1\342A\001\002\372A*\n(discoveryengine.g" + + "oogleapis.com/DataStore\022N\n\nuser_event\030\002 " + + "\001(\0132/.google.cloud.discoveryengine.v1alp" + + "ha.UserEventB\004\342A\001\002H\000\210\001\001B\r\n\013_user_event\"\252" + + "\001\n\027CollectUserEventRequest\022A\n\006parent\030\001 \001" + + "(\tB1\342A\001\002\372A*\n(discoveryengine.googleapis." + + "com/DataStore\022\030\n\nuser_event\030\002 \001(\tB\004\342A\001\002\022" + + "\020\n\003uri\030\003 \001(\tH\000\210\001\001\022\020\n\003ets\030\004 \001(\003H\001\210\001\001B\006\n\004_" + + "uriB\006\n\004_ets2\207\014\n\020UserEventService\022\300\002\n\016Wri" + + "teUserEvent\022;.google.cloud.discoveryengi" + + "ne.v1alpha.WriteUserEventRequest\032/.googl" + + "e.cloud.discoveryengine.v1alpha.UserEven" + + "t\"\277\001\202\323\344\223\002\270\001\"F/v1alpha/{parent=projects/*" + + "/locations/*/dataStores/*}/userEvents:wr" + + "ite:\nuser_eventZb\"T/v1alpha/{parent=proj" + + "ects/*/locations/*/collections/*/dataSto" + + "res/*}/userEvents:write:\nuser_event\022\225\002\n\020" + + "CollectUserEvent\022=.google.cloud.discover" + + "yengine.v1alpha.CollectUserEventRequest\032" + + "\024.google.api.HttpBody\"\253\001\202\323\344\223\002\244\001\022H/v1alph" + + "a/{parent=projects/*/locations/*/dataSto" + + "res/*}/userEvents:collectZX\022V/v1alpha/{p" + + "arent=projects/*/locations/*/collections" + + "/*/dataStores/*}/userEvents:collect\022\235\003\n\017" + + "PurgeUserEvents\022<.google.cloud.discovery" + + "engine.v1alpha.PurgeUserEventsRequest\032\035." + + "google.longrunning.Operation\"\254\002\312A|\n + * Information of an end user. + * + * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.UserInfo} + */ +public final class UserInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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_ = ""; + userAgent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UserInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.CommonProto + .internal_static_google_cloud_discoveryengine_v1alpha_UserInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.CommonProto + .internal_static_google_cloud_discoveryengine_v1alpha_UserInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.UserInfo.class, + com.google.cloud.discoveryengine.v1alpha.UserInfo.Builder.class); + } + + public static final int USER_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object userId_ = ""; + /** + * + * + *
+   * Highly recommended for logged-in users. Unique identifier for logged-in
+   * user, such as a user name. Don't set for anonymous users.
+   *
+   * Always use a hashed value for this ID.
+   *
+   * Don't set the field to the same fixed ID for different users. This mixes
+   * the event history of those users together, which results in degraded
+   * model quality.
+   *
+   * 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. Don't set for anonymous users.
+   *
+   * Always use a hashed value for this ID.
+   *
+   * Don't set the field to the same fixed ID for different users. This mixes
+   * the event history of those users together, which results in degraded
+   * model quality.
+   *
+   * 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 USER_AGENT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object userAgent_ = ""; + /** + * + * + *
+   * User agent as included in the HTTP header.
+   *
+   * 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.discoveryengine.v1alpha.UserEventService.CollectUserEvent]
+   * or if
+   * [UserEvent.direct_user_request][google.cloud.discoveryengine.v1alpha.UserEvent.direct_user_request]
+   * is set.
+   * 
+ * + * string user_agent = 2; + * + * @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.
+   *
+   * 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.discoveryengine.v1alpha.UserEventService.CollectUserEvent]
+   * or if
+   * [UserEvent.direct_user_request][google.cloud.discoveryengine.v1alpha.UserEvent.direct_user_request]
+   * is set.
+   * 
+ * + * string user_agent = 2; + * + * @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; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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(userAgent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, userAgent_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, userId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userAgent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, userAgent_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.UserInfo)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.UserInfo other = + (com.google.cloud.discoveryengine.v1alpha.UserInfo) obj; + + if (!getUserId().equals(other.getUserId())) return false; + if (!getUserAgent().equals(other.getUserAgent())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + USER_ID_FIELD_NUMBER; + hash = (53 * hash) + getUserId().hashCode(); + hash = (37 * hash) + USER_AGENT_FIELD_NUMBER; + hash = (53 * hash) + getUserAgent().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.UserInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.UserInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.UserInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.UserInfo) + com.google.cloud.discoveryengine.v1alpha.UserInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.CommonProto + .internal_static_google_cloud_discoveryengine_v1alpha_UserInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.CommonProto + .internal_static_google_cloud_discoveryengine_v1alpha_UserInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.UserInfo.class, + com.google.cloud.discoveryengine.v1alpha.UserInfo.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.UserInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + userId_ = ""; + userAgent_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.CommonProto + .internal_static_google_cloud_discoveryengine_v1alpha_UserInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UserInfo getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.UserInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UserInfo build() { + com.google.cloud.discoveryengine.v1alpha.UserInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UserInfo buildPartial() { + com.google.cloud.discoveryengine.v1alpha.UserInfo result = + new com.google.cloud.discoveryengine.v1alpha.UserInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.discoveryengine.v1alpha.UserInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.userId_ = userId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.userAgent_ = userAgent_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.UserInfo) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.UserInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.UserInfo other) { + if (other == com.google.cloud.discoveryengine.v1alpha.UserInfo.getDefaultInstance()) + return this; + if (!other.getUserId().isEmpty()) { + userId_ = other.userId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUserAgent().isEmpty()) { + userAgent_ = other.userAgent_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + userId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + userAgent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object userId_ = ""; + /** + * + * + *
+     * Highly recommended for logged-in users. Unique identifier for logged-in
+     * user, such as a user name. Don't set for anonymous users.
+     *
+     * Always use a hashed value for this ID.
+     *
+     * Don't set the field to the same fixed ID for different users. This mixes
+     * the event history of those users together, which results in degraded
+     * model quality.
+     *
+     * 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. Don't set for anonymous users.
+     *
+     * Always use a hashed value for this ID.
+     *
+     * Don't set the field to the same fixed ID for different users. This mixes
+     * the event history of those users together, which results in degraded
+     * model quality.
+     *
+     * 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. Don't set for anonymous users.
+     *
+     * Always use a hashed value for this ID.
+     *
+     * Don't set the field to the same fixed ID for different users. This mixes
+     * the event history of those users together, which results in degraded
+     * model quality.
+     *
+     * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Highly recommended for logged-in users. Unique identifier for logged-in
+     * user, such as a user name. Don't set for anonymous users.
+     *
+     * Always use a hashed value for this ID.
+     *
+     * Don't set the field to the same fixed ID for different users. This mixes
+     * the event history of those users together, which results in degraded
+     * model quality.
+     *
+     * 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(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Highly recommended for logged-in users. Unique identifier for logged-in
+     * user, such as a user name. Don't set for anonymous users.
+     *
+     * Always use a hashed value for this ID.
+     *
+     * Don't set the field to the same fixed ID for different users. This mixes
+     * the event history of those users together, which results in degraded
+     * model quality.
+     *
+     * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object userAgent_ = ""; + /** + * + * + *
+     * User agent as included in the HTTP header.
+     *
+     * 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.discoveryengine.v1alpha.UserEventService.CollectUserEvent]
+     * or if
+     * [UserEvent.direct_user_request][google.cloud.discoveryengine.v1alpha.UserEvent.direct_user_request]
+     * is set.
+     * 
+ * + * string user_agent = 2; + * + * @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.
+     *
+     * 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.discoveryengine.v1alpha.UserEventService.CollectUserEvent]
+     * or if
+     * [UserEvent.direct_user_request][google.cloud.discoveryengine.v1alpha.UserEvent.direct_user_request]
+     * is set.
+     * 
+ * + * string user_agent = 2; + * + * @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.
+     *
+     * 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.discoveryengine.v1alpha.UserEventService.CollectUserEvent]
+     * or if
+     * [UserEvent.direct_user_request][google.cloud.discoveryengine.v1alpha.UserEvent.direct_user_request]
+     * is set.
+     * 
+ * + * string user_agent = 2; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * User agent as included in the HTTP header.
+     *
+     * 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.discoveryengine.v1alpha.UserEventService.CollectUserEvent]
+     * or if
+     * [UserEvent.direct_user_request][google.cloud.discoveryengine.v1alpha.UserEvent.direct_user_request]
+     * is set.
+     * 
+ * + * string user_agent = 2; + * + * @return This builder for chaining. + */ + public Builder clearUserAgent() { + userAgent_ = getDefaultInstance().getUserAgent(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * User agent as included in the HTTP header.
+     *
+     * 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.discoveryengine.v1alpha.UserEventService.CollectUserEvent]
+     * or if
+     * [UserEvent.direct_user_request][google.cloud.discoveryengine.v1alpha.UserEvent.direct_user_request]
+     * is set.
+     * 
+ * + * string user_agent = 2; + * + * @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; + bitField0_ |= 0x00000002; + 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.discoveryengine.v1alpha.UserInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.UserInfo) + private static final com.google.cloud.discoveryengine.v1alpha.UserInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.UserInfo(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UserInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserInfoOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserInfoOrBuilder.java new file mode 100644 index 000000000000..bdf121901f08 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/UserInfoOrBuilder.java @@ -0,0 +1,115 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/common.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface UserInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.UserInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Highly recommended for logged-in users. Unique identifier for logged-in
+   * user, such as a user name. Don't set for anonymous users.
+   *
+   * Always use a hashed value for this ID.
+   *
+   * Don't set the field to the same fixed ID for different users. This mixes
+   * the event history of those users together, which results in degraded
+   * model quality.
+   *
+   * 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. Don't set for anonymous users.
+   *
+   * Always use a hashed value for this ID.
+   *
+   * Don't set the field to the same fixed ID for different users. This mixes
+   * the event history of those users together, which results in degraded
+   * model quality.
+   *
+   * 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(); + + /** + * + * + *
+   * User agent as included in the HTTP header.
+   *
+   * 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.discoveryengine.v1alpha.UserEventService.CollectUserEvent]
+   * or if
+   * [UserEvent.direct_user_request][google.cloud.discoveryengine.v1alpha.UserEvent.direct_user_request]
+   * is set.
+   * 
+ * + * string user_agent = 2; + * + * @return The userAgent. + */ + java.lang.String getUserAgent(); + /** + * + * + *
+   * User agent as included in the HTTP header.
+   *
+   * 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.discoveryengine.v1alpha.UserEventService.CollectUserEvent]
+   * or if
+   * [UserEvent.direct_user_request][google.cloud.discoveryengine.v1alpha.UserEvent.direct_user_request]
+   * is set.
+   * 
+ * + * string user_agent = 2; + * + * @return The bytes for userAgent. + */ + com.google.protobuf.ByteString getUserAgentBytes(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/WriteUserEventRequest.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/WriteUserEventRequest.java new file mode 100644 index 000000000000..1056f4d7348a --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/WriteUserEventRequest.java @@ -0,0 +1,955 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/user_event_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +/** + * + * + *
+ * Request message for WriteUserEvent method.
+ * 
+ * + * Protobuf type {@code google.cloud.discoveryengine.v1alpha.WriteUserEventRequest} + */ +public final class WriteUserEventRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1alpha.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.UserEventServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_WriteUserEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.UserEventServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_WriteUserEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest.class, + com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent DataStore resource name, such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+   * 
+ * + * + * 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 DataStore resource name, such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+   * 
+ * + * + * 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 USER_EVENT_FIELD_NUMBER = 2; + private com.google.cloud.discoveryengine.v1alpha.UserEvent userEvent_; + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * optional .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEvent field is set. + */ + @java.lang.Override + public boolean hasUserEvent() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * optional .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UserEvent getUserEvent() { + return userEvent_ == null + ? com.google.cloud.discoveryengine.v1alpha.UserEvent.getDefaultInstance() + : userEvent_; + } + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * optional .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.UserEventOrBuilder getUserEventOrBuilder() { + return userEvent_ == null + ? com.google.cloud.discoveryengine.v1alpha.UserEvent.getDefaultInstance() + : userEvent_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getUserEvent()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUserEvent()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest)) { + return super.equals(obj); + } + com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest other = + (com.google.cloud.discoveryengine.v1alpha.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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.WriteUserEventRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.WriteUserEventRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.WriteUserEventRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.WriteUserEventRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.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.discoveryengine.v1alpha.WriteUserEventRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1alpha.WriteUserEventRequest) + com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.discoveryengine.v1alpha.UserEventServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_WriteUserEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.discoveryengine.v1alpha.UserEventServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_WriteUserEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest.class, + com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest.Builder.class); + } + + // Construct using com.google.cloud.discoveryengine.v1alpha.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) { + getUserEventFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + userEvent_ = null; + if (userEventBuilder_ != null) { + userEventBuilder_.dispose(); + userEventBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.discoveryengine.v1alpha.UserEventServiceProto + .internal_static_google_cloud_discoveryengine_v1alpha_WriteUserEventRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest + getDefaultInstanceForType() { + return com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest build() { + com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest buildPartial() { + com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest result = + new com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.userEvent_ = userEventBuilder_ == null ? userEvent_ : userEventBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest) { + return mergeFrom((com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest other) { + if (other + == com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasUserEvent()) { + mergeUserEvent(other.getUserEvent()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUserEventFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent DataStore resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+     * 
+ * + * + * 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 DataStore resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+     * 
+ * + * + * 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 DataStore resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent DataStore resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent DataStore resource name, such as
+     * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.discoveryengine.v1alpha.UserEvent userEvent_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.UserEvent, + com.google.cloud.discoveryengine.v1alpha.UserEvent.Builder, + com.google.cloud.discoveryengine.v1alpha.UserEventOrBuilder> + userEventBuilder_; + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * optional .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEvent field is set. + */ + public boolean hasUserEvent() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * optional .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + public com.google.cloud.discoveryengine.v1alpha.UserEvent getUserEvent() { + if (userEventBuilder_ == null) { + return userEvent_ == null + ? com.google.cloud.discoveryengine.v1alpha.UserEvent.getDefaultInstance() + : userEvent_; + } else { + return userEventBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * optional .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEvent(com.google.cloud.discoveryengine.v1alpha.UserEvent value) { + if (userEventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + userEvent_ = value; + } else { + userEventBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * optional .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUserEvent( + com.google.cloud.discoveryengine.v1alpha.UserEvent.Builder builderForValue) { + if (userEventBuilder_ == null) { + userEvent_ = builderForValue.build(); + } else { + userEventBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * optional .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUserEvent(com.google.cloud.discoveryengine.v1alpha.UserEvent value) { + if (userEventBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && userEvent_ != null + && userEvent_ + != com.google.cloud.discoveryengine.v1alpha.UserEvent.getDefaultInstance()) { + getUserEventBuilder().mergeFrom(value); + } else { + userEvent_ = value; + } + } else { + userEventBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * optional .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUserEvent() { + bitField0_ = (bitField0_ & ~0x00000002); + userEvent_ = null; + if (userEventBuilder_ != null) { + userEventBuilder_.dispose(); + userEventBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * optional .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.UserEvent.Builder getUserEventBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUserEventFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * optional .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.discoveryengine.v1alpha.UserEventOrBuilder getUserEventOrBuilder() { + if (userEventBuilder_ != null) { + return userEventBuilder_.getMessageOrBuilder(); + } else { + return userEvent_ == null + ? com.google.cloud.discoveryengine.v1alpha.UserEvent.getDefaultInstance() + : userEvent_; + } + } + /** + * + * + *
+     * Required. User event to write.
+     * 
+ * + * + * optional .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.UserEvent, + com.google.cloud.discoveryengine.v1alpha.UserEvent.Builder, + com.google.cloud.discoveryengine.v1alpha.UserEventOrBuilder> + getUserEventFieldBuilder() { + if (userEventBuilder_ == null) { + userEventBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.discoveryengine.v1alpha.UserEvent, + com.google.cloud.discoveryengine.v1alpha.UserEvent.Builder, + com.google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.WriteUserEventRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1alpha.WriteUserEventRequest) + private static final com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest(); + } + + public static com.google.cloud.discoveryengine.v1alpha.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/WriteUserEventRequestOrBuilder.java b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/WriteUserEventRequestOrBuilder.java new file mode 100644 index 000000000000..b0c8a586b68a --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/java/com/google/cloud/discoveryengine/v1alpha/WriteUserEventRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/discoveryengine/v1alpha/user_event_service.proto + +package com.google.cloud.discoveryengine.v1alpha; + +public interface WriteUserEventRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1alpha.WriteUserEventRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent DataStore resource name, such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent DataStore resource name, such as
+   * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * optional .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the userEvent field is set. + */ + boolean hasUserEvent(); + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * optional .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userEvent. + */ + com.google.cloud.discoveryengine.v1alpha.UserEvent getUserEvent(); + /** + * + * + *
+   * Required. User event to write.
+   * 
+ * + * + * optional .google.cloud.discoveryengine.v1alpha.UserEvent user_event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.discoveryengine.v1alpha.UserEventOrBuilder getUserEventOrBuilder(); +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/common.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/common.proto new file mode 100644 index 000000000000..927770088343 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/common.proto @@ -0,0 +1,155 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.discoveryengine.v1alpha; + +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.cloud.discoveryengine.v1alpha"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha"; +option (google.api.resource_definition) = { + type: "discoveryengine.googleapis.com/Branch" + pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}" + pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}" +}; +option (google.api.resource_definition) = { + type: "discoveryengine.googleapis.com/DataStore" + pattern: "projects/{project}/locations/{location}/dataStores/{data_store}" + pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}" +}; +option (google.api.resource_definition) = { + type: "discoveryengine.googleapis.com/ServingConfig" + pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}" + pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}" + pattern: "projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}" +}; +option (google.api.resource_definition) = { + type: "discoveryengine.googleapis.com/SiteSearchEngine", + pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine" + pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine" +}; + +// The type of solution. +enum SolutionType { + // Default value. + SOLUTION_TYPE_UNSPECIFIED = 0; + + // Used for Recommendations AI. + SOLUTION_TYPE_RECOMMENDATION = 1; + + // Used for Discovery Search. + SOLUTION_TYPE_SEARCH = 2; + + // Used for use cases related to the Generative AI agent. + SOLUTION_TYPE_CHAT = 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. + // 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. + // Otherwise, an `INVALID_ARGUMENT` error is returned. + oneof max { + // Inclusive upper bound. + double maximum = 3; + + // Exclusive upper bound. + double exclusive_maximum = 4; + } +} + +// A custom attribute that is not explicitly modeled in a resource, e.g. +// [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent]. +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 + // [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text] + // or + // [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.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 + // [CustomAttribute.text][google.cloud.discoveryengine.v1alpha.CustomAttribute.text] + // or + // [CustomAttribute.numbers][google.cloud.discoveryengine.v1alpha.CustomAttribute.numbers] + // should be set. Otherwise, an `INVALID_ARGUMENT` error is returned. + repeated double numbers = 2; +} + +// Information of an end user. +message UserInfo { + // Highly recommended for logged-in users. Unique identifier for logged-in + // user, such as a user name. Don't set for anonymous users. + // + // Always use a hashed value for this ID. + // + // Don't set the field to the same fixed ID for different users. This mixes + // the event history of those users together, which results in degraded + // model quality. + // + // 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; + + // User agent as included in the HTTP header. + // + // 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.discoveryengine.v1alpha.UserEventService.CollectUserEvent] + // or if + // [UserEvent.direct_user_request][google.cloud.discoveryengine.v1alpha.UserEvent.direct_user_request] + // is set. + string user_agent = 2; +} + +// Double list. +message DoubleList { + // Double values. + repeated double values = 1; +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/completion_service.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/completion_service.proto new file mode 100644 index 000000000000..d035688e3bc6 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/completion_service.proto @@ -0,0 +1,134 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.discoveryengine.v1alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "CompletionServiceProto"; +option java_package = "com.google.cloud.discoveryengine.v1alpha"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha"; + +// Service for Auto-Completion. +service CompletionService { + option (google.api.default_host) = "discoveryengine.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Completes the specified user input with keyword suggestions. + rpc CompleteQuery(CompleteQueryRequest) returns (CompleteQueryResponse) { + option (google.api.http) = { + get: "/v1alpha/{data_store=projects/*/locations/*/dataStores/*}:completeQuery" + additional_bindings { + get: "/v1alpha/{data_store=projects/*/locations/*/collections/*/dataStores/*}:completeQuery" + } + }; + } +} + +// Request message for +// [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery] +// method. +message CompleteQueryRequest { + // Required. The parent data store resource name for which the completion is + // performed, such as + // `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. + string data_store = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/DataStore" + } + ]; + + // Required. The typeahead input used to fetch suggestions. Maximum length is + // 128 characters. + string query = 2 [(google.api.field_behavior) = REQUIRED]; + + // Selects data model of query suggestions for serving. Currently supported + // values: + // + // * `document` - Using suggestions generated from user-imported documents. + // * `search-history` - Using suggestions generated from the past history of + // [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search] + // API calls. Do not use it when there is no traffic for Search API. + // * `user-event` - Using suggestions generated from user-imported search + // events. + // * `document-completable` - Using suggestions taken directly from + // user-imported document fields marked as completable. + // + // Default values: + // + // * `document` is the default model for regular dataStores. + // * `search-history` is the default model for site search dataStores. + string query_model = 3; + + // 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 field should NOT have a fixed value such as `unknown_visitor`. + // + // This should be the same identifier as + // [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id] + // and + // [SearchRequest.user_pseudo_id][google.cloud.discoveryengine.v1alpha.SearchRequest.user_pseudo_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_pseudo_id = 4; + + // Indicates if tail suggestions should be returned if there are no + // suggestions that match the full query. Even if set to true, if there are + // suggestions that match the full query, those are returned and no + // tail suggestions are returned. + bool include_tail_suggestions = 5; +} + +// Response message for +// [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery] +// method. +message CompleteQueryResponse { + // Suggestions as search queries. + message QuerySuggestion { + // The suggestion for the query. + string suggestion = 1; + + // The unique document field paths that serve as the source of this + // suggestion if it was generated from completable fields. + // + // This field is only populated for the document-completable model. + repeated string completable_field_paths = 2; + } + + // Results of the matched query suggestions. The result list is ordered and + // the first result is a top suggestion. + repeated QuerySuggestion query_suggestions = 1; + + // True if the returned suggestions are all tail suggestions. + // + // For tail matching to be triggered, include_tail_suggestions in the request + // must be true and there must be no suggestions that match the full query. + bool tail_match_triggered = 2; +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/conversation.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/conversation.proto new file mode 100644 index 000000000000..8da3bdeb4efa --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/conversation.proto @@ -0,0 +1,138 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.discoveryengine.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/discoveryengine/v1alpha/search_service.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "ConversationProto"; +option java_package = "com.google.cloud.discoveryengine.v1alpha"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha"; + +// External conversation proto definition. +message Conversation { + option (google.api.resource) = { + type: "discoveryengine.googleapis.com/Conversation" + pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}" + pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/conversations/{conversation}" + }; + + // Enumeration of the state of the conversation. + enum State { + // Unknown. + STATE_UNSPECIFIED = 0; + + // Conversation is currently open. + IN_PROGRESS = 1; + + // Conversation has been completed. + COMPLETED = 2; + } + + // Immutable. Fully qualified name + // `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*` + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // The state of the Conversation. + State state = 2; + + // A unique identifier for tracking users. + string user_pseudo_id = 3; + + // Conversation messages. + repeated ConversationMessage messages = 4; + + // Output only. The time the conversation started. + google.protobuf.Timestamp start_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the conversation finished. + google.protobuf.Timestamp end_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Defines a reply message to user. +message Reply { + // Defines reference in reply. + message Reference { + option deprecated = true; + + // URI link reference. + string uri = 1; + + // Anchor text. + string anchor_text = 2; + + // Anchor text start index. + int32 start = 3; + + // Anchor text end index. + int32 end = 4; + } + + // DEPRECATED: use `summary` instead. + // Text reply. + string reply = 1 [deprecated = true]; + + // References in the reply. + repeated Reference references = 2 [deprecated = true]; + + // Summary based on search results. + SearchResponse.Summary summary = 3; +} + +// Defines context of the conversation +message ConversationContext { + // The current list of documents the user is seeing. + // It contains the document resource references. + repeated string context_documents = 1; + + // The current active document the user opened. + // It contains the document resource reference. + string active_document = 2; +} + +// Defines text input. +message TextInput { + // Text input. + string input = 1; + + // Conversation context of the input. + ConversationContext context = 2; +} + +// Defines a conversation message. +message ConversationMessage { + oneof message { + // User text input. + TextInput user_input = 1; + + // Search reply. + Reply reply = 2; + } + + // Output only. Message creation timestamp. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/conversational_search_service.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/conversational_search_service.proto new file mode 100644 index 000000000000..ffa61ad43edc --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/conversational_search_service.proto @@ -0,0 +1,306 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.discoveryengine.v1alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/discoveryengine/v1alpha/conversation.proto"; +import "google/cloud/discoveryengine/v1alpha/search_service.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "ConversationalSearchServiceProto"; +option java_package = "com.google.cloud.discoveryengine.v1alpha"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha"; + +// Service for conversational search. +service ConversationalSearchService { + option (google.api.default_host) = "discoveryengine.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Converses a conversation. + rpc ConverseConversation(ConverseConversationRequest) + returns (ConverseConversationResponse) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/locations/*/dataStores/*/conversations/*}:converse" + body: "*" + additional_bindings { + post: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}:converse" + body: "*" + } + }; + option (google.api.method_signature) = "name,query"; + } + + // Creates a Conversation. + // + // If the [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to + // create already exists, an ALREADY_EXISTS error is returned. + rpc CreateConversation(CreateConversationRequest) returns (Conversation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*/dataStores/*}/conversations" + body: "conversation" + additional_bindings { + post: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*}/conversations" + body: "conversation" + } + }; + option (google.api.method_signature) = "parent,conversation"; + } + + // Deletes a Conversation. + // + // If the [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to + // delete does not exist, a NOT_FOUND error is returned. + rpc DeleteConversation(DeleteConversationRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/locations/*/dataStores/*/conversations/*}" + additional_bindings { + delete: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Updates a Conversation. + // + // [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] action + // type cannot be changed. If the + // [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to update + // does not exist, a NOT_FOUND error is returned. + rpc UpdateConversation(UpdateConversationRequest) returns (Conversation) { + option (google.api.http) = { + patch: "/v1alpha/{conversation.name=projects/*/locations/*/dataStores/*/conversations/*}" + body: "conversation" + additional_bindings { + patch: "/v1alpha/{conversation.name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}" + body: "conversation" + } + }; + option (google.api.method_signature) = "conversation,update_mask"; + } + + // Gets a Conversation. + rpc GetConversation(GetConversationRequest) returns (Conversation) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/dataStores/*/conversations/*}" + additional_bindings { + get: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists all Conversations by their parent + // [DataStore][google.cloud.discoveryengine.v1alpha.DataStore]. + rpc ListConversations(ListConversationsRequest) + returns (ListConversationsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*/dataStores/*}/conversations" + additional_bindings { + get: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*}/conversations" + } + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request message for +// [ConversationalSearchService.ConverseConversation][google.cloud.discoveryengine.v1alpha.ConversationalSearchService.ConverseConversation] +// method. +message ConverseConversationRequest { + // Required. The resource name of the Conversation to get. Format: + // `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. + // Use + // `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-` + // to activate auto session mode, which automatically creates a new + // conversation inside a ConverseConversation session. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Conversation" + } + ]; + + // Required. Current user input. + TextInput query = 2 [(google.api.field_behavior) = REQUIRED]; + + // The resource name of the Serving Config to use. Format: + // `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` + // If this is not set, the default serving config will be used. + string serving_config = 3 [(google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/ServingConfig" + }]; + + // The conversation to be used by auto session only. The name field will be + // ignored as we automatically assign new name for the conversation in auto + // session. + Conversation conversation = 5; + + // Whether to turn on safe search. + bool safe_search = 6; + + // The user 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 user_labels = 7; + + // A specification for configuring the summary returned in the response. + SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8; +} + +// Response message for +// [ConversationalSearchService.ConverseConversation][google.cloud.discoveryengine.v1alpha.ConversationalSearchService.ConverseConversation] +// method. +message ConverseConversationResponse { + // Answer to the current query. + Reply reply = 1; + + // Updated conversation including the answer. + Conversation conversation = 2; + + // Suggested related questions. + repeated string related_questions = 6; + + // Search Results. + repeated SearchResponse.SearchResult search_results = 3; +} + +// Request for CreateConversation method. +message CreateConversationRequest { + // Required. Full resource name of parent data store. Format: + // `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/DataStore" + } + ]; + + // Required. The conversation to create. + Conversation conversation = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for UpdateConversation method. +message UpdateConversationRequest { + // Required. The Conversation to update. + Conversation conversation = 1 [(google.api.field_behavior) = REQUIRED]; + + // Indicates which fields in the provided + // [Conversation][google.cloud.discoveryengine.v1alpha.Conversation] to + // update. The following are NOT supported: + // + // * [conversation.name][] + // + // If not set or empty, all supported fields are updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request for DeleteConversation method. +message DeleteConversationRequest { + // Required. The resource name of the Conversation to delete. Format: + // `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Conversation" + } + ]; +} + +// Request for GetConversation method. +message GetConversationRequest { + // Required. The resource name of the Conversation to get. Format: + // `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Conversation" + } + ]; +} + +// Request for ListConversations method. +message ListConversationsRequest { + // Required. The data store resource name. Format: + // `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/DataStore" + } + ]; + + // Maximum number of results to return. If unspecified, defaults + // to 50. Max allowed value is 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListConversations` call. + // Provide this to retrieve the subsequent page. + string page_token = 3; + + // A filter to apply on the list results. The supported features are: + // user_pseudo_id, state. + // + // Example: + // "user_pseudo_id = some_id" + string filter = 4; + + // A comma-separated list of fields to order by, sorted in ascending order. + // Use "desc" after a field name for descending. + // Supported fields: + // * `update_time` + // * `create_time` + // * `conversation_name` + // + // Example: + // "update_time desc" + // "create_time" + string order_by = 5; +} + +// Response for ListConversations method. +message ListConversationsResponse { + // All the Conversations for a given data store. + repeated Conversation conversations = 1; + + // Pagination token, if not returned indicates the last page. + string next_page_token = 2; +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/document.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/document.proto new file mode 100644 index 000000000000..eb93e786f3fb --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/document.proto @@ -0,0 +1,121 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.discoveryengine.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentProto"; +option java_package = "com.google.cloud.discoveryengine.v1alpha"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha"; + +// Document captures all raw metadata information of items to be recommended or +// searched. +message Document { + option (google.api.resource) = { + type: "discoveryengine.googleapis.com/Document" + pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}" + pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}" + }; + + // Unstructured data linked to this document. + message Content { + oneof content { + // The content represented as a stream of bytes. The maximum length is + // 1,000,000 bytes (1 MB / ~0.95 MiB). + // + // Note: As with all `bytes` fields, this field is represented as pure + // binary in Protocol Buffers and base64-encoded string in JSON. For + // example, `abc123!?$*&()'-=@~` should be represented as + // `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See + // https://developers.google.com/protocol-buffers/docs/proto3#json. + bytes raw_bytes = 2; + + // The URI of the content. Only Cloud Storage URIs (e.g. + // `gs://bucket-name/path/to/file`) are supported. The maximum file size + // is 100 MB. + string uri = 3; + } + + // The MIME type of the content. Supported types: + // + // * `application/pdf` (PDF, only native PDFs are supported for now) + // * `text/html` (HTML) + // * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX) + // * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX) + // * `text/plain` (TXT) + // + // See https://www.iana.org/assignments/media-types/media-types.xhtml. + string mime_type = 1; + } + + // Data representation. One of + // [struct_data][google.cloud.discoveryengine.v1alpha.Document.struct_data] or + // [json_data][google.cloud.discoveryengine.v1alpha.Document.json_data] should + // be provided otherwise an `INVALID_ARGUMENT` error is thrown. + oneof data { + // The structured JSON data for the document. It should conform to the + // registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an + // `INVALID_ARGUMENT` error is thrown. + google.protobuf.Struct struct_data = 4; + + // The JSON string representation of the document. It should conform to the + // registered [Schema][google.cloud.discoveryengine.v1alpha.Schema] or an + // `INVALID_ARGUMENT` error is thrown. + string json_data = 5; + } + + // Immutable. The full resource name of the document. + // Format: + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. + // + // This field must be a UTF-8 encoded string with a length limit of 1024 + // characters. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The identifier of the document. + // + // Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) + // standard with a length limit of 63 characters. + string id = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // The identifier of the schema located in the same data store. + string schema_id = 3; + + // The unstructured data linked to this document. Content must be set if this + // document is under a + // `CONTENT_REQUIRED` data store. + Content content = 10; + + // The identifier of the parent document. Currently supports at most two level + // document hierarchy. + // + // Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) + // standard with a length limit of 63 characters. + string parent_document_id = 7; + + // Output only. This field is OUTPUT_ONLY. + // It contains derived data that are not in the original input document. + google.protobuf.Struct derived_struct_data = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/document_service.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/document_service.proto new file mode 100644 index 000000000000..84dfae08727d --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/document_service.proto @@ -0,0 +1,318 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.discoveryengine.v1alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/discoveryengine/v1alpha/document.proto"; +import "google/cloud/discoveryengine/v1alpha/import_config.proto"; +import "google/cloud/discoveryengine/v1alpha/purge_config.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentServiceProto"; +option java_package = "com.google.cloud.discoveryengine.v1alpha"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha"; + +// Service for ingesting +// [Document][google.cloud.discoveryengine.v1alpha.Document] information of the +// customer's website. +service DocumentService { + option (google.api.default_host) = "discoveryengine.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Gets a [Document][google.cloud.discoveryengine.v1alpha.Document]. + rpc GetDocument(GetDocumentRequest) returns (Document) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}" + additional_bindings { + get: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Gets a list of [Document][google.cloud.discoveryengine.v1alpha.Document]s. + rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents" + additional_bindings { + get: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a [Document][google.cloud.discoveryengine.v1alpha.Document]. + rpc CreateDocument(CreateDocumentRequest) returns (Document) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents" + body: "document" + additional_bindings { + post: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents" + body: "document" + } + }; + option (google.api.method_signature) = "parent,document,document_id"; + } + + // Updates a [Document][google.cloud.discoveryengine.v1alpha.Document]. + rpc UpdateDocument(UpdateDocumentRequest) returns (Document) { + option (google.api.http) = { + patch: "/v1alpha/{document.name=projects/*/locations/*/dataStores/*/branches/*/documents/*}" + body: "document" + additional_bindings { + patch: "/v1alpha/{document.name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}" + body: "document" + } + }; + } + + // Deletes a [Document][google.cloud.discoveryengine.v1alpha.Document]. + rpc DeleteDocument(DeleteDocumentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}" + additional_bindings { + delete: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Bulk import of multiple + // [Document][google.cloud.discoveryengine.v1alpha.Document]s. Request + // processing may be synchronous. Non-existing items will be created. + // + // Note: It is possible for a subset of the + // [Document][google.cloud.discoveryengine.v1alpha.Document]s to be + // successfully updated. + rpc ImportDocuments(ImportDocumentsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:import" + body: "*" + additional_bindings { + post: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:import" + body: "*" + } + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse" + metadata_type: "google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata" + }; + } + + // Permanently deletes all selected + // [Document][google.cloud.discoveryengine.v1alpha.Document]s in a branch. + // + // This process is asynchronous. Depending on the number of + // [Document][google.cloud.discoveryengine.v1alpha.Document]s to be deleted, + // this operation can take hours to complete. Before the delete operation + // completes, some [Document][google.cloud.discoveryengine.v1alpha.Document]s + // might still be returned by + // [DocumentService.GetDocument][google.cloud.discoveryengine.v1alpha.DocumentService.GetDocument] + // or + // [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments]. + // + // To get a list of the + // [Document][google.cloud.discoveryengine.v1alpha.Document]s to be deleted, + // set + // [PurgeDocumentsRequest.force][google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest.force] + // to false. + rpc PurgeDocuments(PurgeDocumentsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:purge" + body: "*" + additional_bindings { + post: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:purge" + body: "*" + } + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse" + metadata_type: "google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata" + }; + } +} + +// Request message for +// [DocumentService.GetDocument][google.cloud.discoveryengine.v1alpha.DocumentService.GetDocument] +// method. +message GetDocumentRequest { + // Required. Full resource name of + // [Document][google.cloud.discoveryengine.v1alpha.Document], such as + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. + // + // If the caller does not have permission to access the + // [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of + // whether or not it exists, a `PERMISSION_DENIED` error is returned. + // + // If the requested [Document][google.cloud.discoveryengine.v1alpha.Document] + // does not exist, a `NOT_FOUND` error is returned. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Document" + } + ]; +} + +// Request message for +// [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments] +// method. +message ListDocumentsRequest { + // Required. The parent branch resource name, such as + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + // Use `default_branch` as the branch ID, to list documents under the default + // branch. + // + // If the caller does not have permission to list + // [Document][google.cloud.discoveryengine.v1alpha.Document]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: "discoveryengine.googleapis.com/Branch" + } + ]; + + // Maximum number of + // [Document][google.cloud.discoveryengine.v1alpha.Document]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 + // [ListDocumentsResponse.next_page_token][google.cloud.discoveryengine.v1alpha.ListDocumentsResponse.next_page_token], + // received from a previous + // [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments] + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments] + // must match the call that provided the page token. Otherwise, an + // `INVALID_ARGUMENT` error is returned. + string page_token = 3; +} + +// Response message for +// [DocumentService.ListDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.ListDocuments] +// method. +message ListDocumentsResponse { + // The [Document][google.cloud.discoveryengine.v1alpha.Document]s. + repeated Document documents = 1; + + // A token that can be sent as + // [ListDocumentsRequest.page_token][google.cloud.discoveryengine.v1alpha.ListDocumentsRequest.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 +// [DocumentService.CreateDocument][google.cloud.discoveryengine.v1alpha.DocumentService.CreateDocument] +// method. +message CreateDocumentRequest { + // Required. The parent resource name, such as + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Branch" + } + ]; + + // Required. The [Document][google.cloud.discoveryengine.v1alpha.Document] to + // create. + Document document = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the + // [Document][google.cloud.discoveryengine.v1alpha.Document], which will + // become the final component of the + // [Document.name][google.cloud.discoveryengine.v1alpha.Document.name]. + // + // If the caller does not have permission to create the + // [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of + // whether or not it exists, a `PERMISSION_DENIED` error is returned. + // + // This field must be unique among all + // [Document][google.cloud.discoveryengine.v1alpha.Document]s with the same + // [parent][google.cloud.discoveryengine.v1alpha.CreateDocumentRequest.parent]. + // Otherwise, an `ALREADY_EXISTS` error is returned. + // + // This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) + // standard with a length limit of 63 characters. Otherwise, an + // `INVALID_ARGUMENT` error is returned. + string document_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [DocumentService.UpdateDocument][google.cloud.discoveryengine.v1alpha.DocumentService.UpdateDocument] +// method. +message UpdateDocumentRequest { + // Required. The document to update/create. + // + // If the caller does not have permission to update the + // [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of + // whether or not it exists, a `PERMISSION_DENIED` error is returned. + // + // If the [Document][google.cloud.discoveryengine.v1alpha.Document] to update + // does not exist and + // [allow_missing][google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest.allow_missing] + // is not set, a `NOT_FOUND` error is returned. + Document document = 1 [(google.api.field_behavior) = REQUIRED]; + + // If set to true, and the + // [Document][google.cloud.discoveryengine.v1alpha.Document] is not found, a + // new [Document][google.cloud.discoveryengine.v1alpha.Document] will be + // created. + bool allow_missing = 2; +} + +// Request message for +// [DocumentService.DeleteDocument][google.cloud.discoveryengine.v1alpha.DocumentService.DeleteDocument] +// method. +message DeleteDocumentRequest { + // Required. Full resource name of + // [Document][google.cloud.discoveryengine.v1alpha.Document], such as + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. + // + // If the caller does not have permission to delete the + // [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of + // whether or not it exists, a `PERMISSION_DENIED` error is returned. + // + // If the [Document][google.cloud.discoveryengine.v1alpha.Document] to delete + // does not exist, a `NOT_FOUND` error is returned. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Document" + } + ]; +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/import_config.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/import_config.proto new file mode 100644 index 000000000000..8902565bad38 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/import_config.proto @@ -0,0 +1,343 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.discoveryengine.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/discoveryengine/v1alpha/document.proto"; +import "google/cloud/discoveryengine/v1alpha/user_event.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/type/date.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "ImportConfigProto"; +option java_package = "com.google.cloud.discoveryengine.v1alpha"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha"; + +// Cloud Storage location for input content. +message GcsSource { + // Required. 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 (or 100,000 files if `data_schema` + // is `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` is + // `content`). + repeated string input_uris = 1 [(google.api.field_behavior) = REQUIRED]; + + // The schema to use when parsing the data from the source. + // + // Supported values for document imports: + // + // * `document` (default): One JSON + // [Document][google.cloud.discoveryengine.v1alpha.Document] per line. Each + // document must + // have a valid + // [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]. + // * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by + // `input_uris` becomes a document, with the ID set to the first 128 + // bits of SHA256(URI) encoded as a hex string. + // * `custom`: One custom data JSON per row in arbitrary format that conforms + // to the defined [Schema][google.cloud.discoveryengine.v1alpha.Schema] of + // the data store. This can only be used by Gen App Builder. + // * `csv`: A CSV file with header conforming to the defined + // [Schema][google.cloud.discoveryengine.v1alpha.Schema] of the + // data store. Each entry after the header is imported as a Document. + // This can only be used by Gen App Builder. + // + // Supported values for user even imports: + // + // * `user_event` (default): One JSON + // [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] 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. + google.type.Date partition_date = 5; + } + + // 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 = 1; + + // Required. The BigQuery data set to copy the data from with a length limit + // of 1,024 characters. + string dataset_id = 2 [(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 = 3 [(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 = 4; + + // The schema to use when parsing the data from the source. + // + // Supported values for user event imports: + // + // * `user_event` (default): One + // [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] per row. + // + // Supported values for document imports: + // + // * `document` (default): One + // [Document][google.cloud.discoveryengine.v1alpha.Document] format per + // row. Each document must have a valid + // [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] and one + // of + // [Document.json_data][google.cloud.discoveryengine.v1alpha.Document.json_data] + // or + // [Document.struct_data][google.cloud.discoveryengine.v1alpha.Document.struct_data]. + // * `custom`: One custom data per row in arbitrary format that conforms to + // the defined [Schema][google.cloud.discoveryengine.v1alpha.Schema] of the + // data store. This can only be used by Gen App Builder. + string data_schema = 6; +} + +// Configuration of destination for Import related errors. +message ImportErrorConfig { + // Required. Errors destination. + oneof destination { + // Cloud Storage prefix for import errors. This must be an empty, + // existing Cloud Storage directory. Import errors are written to + // sharded files in this directory, one per line, as a JSON-encoded + // `google.rpc.Status` message. + string gcs_prefix = 1; + } +} + +// Request message for the ImportUserEvents request. +message ImportUserEventsRequest { + // The inline source for the input config for ImportUserEvents method. + message InlineSource { + // Required. A list of user events to import. Recommended max of 10k items. + repeated UserEvent user_events = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Required - The desired input source of the user event data. + oneof source { + // The Inline source for the input content for UserEvents. + InlineSource inline_source = 2; + + // Cloud Storage location for the input content. + GcsSource gcs_source = 3; + + // BigQuery input source. + BigQuerySource bigquery_source = 4; + } + + // Required. Parent DataStore resource name, of the form + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/DataStore" + } + ]; + + // The desired location of errors incurred during the Import. Cannot be set + // for inline user event imports. + ImportErrorConfig error_config = 5; +} + +// 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. + ImportErrorConfig error_config = 2; + + // Count of user events imported with complete existing Documents. + int64 joined_events_count = 3; + + // Count of user events imported, but with Document information not found + // in the existing Branch. + int64 unjoined_events_count = 4; +} + +// Metadata related to the progress of the Import operation. This is +// returned by the google.longrunning.Operation.metadata field. +message ImportUserEventsMetadata { + // 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; +} + +// Metadata related to the progress of the ImportDocuments operation. This is +// returned by the google.longrunning.Operation.metadata field. +message ImportDocumentsMetadata { + // 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; +} + +// Request message for Import methods. +message ImportDocumentsRequest { + // The inline source for the input config for ImportDocuments method. + message InlineSource { + // Required. A list of documents to update/create. Each document must have a + // valid [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]. + // Recommended max of 100 items. + repeated Document documents = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Indicates how imported documents are reconciled with the existing documents + // created or imported before. + enum ReconciliationMode { + // Defaults to `INCREMENTAL`. + RECONCILIATION_MODE_UNSPECIFIED = 0; + + // Inserts new documents or updates existing documents. + INCREMENTAL = 1; + + // Calculates diff and replaces the entire document dataset. Existing + // documents may be deleted if they are not present in the source location. + FULL = 2; + } + + // Required. The source of the input. + oneof source { + // The Inline source for the input content for documents. + InlineSource inline_source = 2; + + // Cloud Storage location for the input content. + GcsSource gcs_source = 3; + + // BigQuery input source. + BigQuerySource bigquery_source = 4; + } + + // Required. The parent branch resource name, such as + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + // Requires create/update permission. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Branch" + } + ]; + + // The desired location of errors incurred during the Import. + ImportErrorConfig error_config = 5; + + // The mode of reconciliation between existing documents and the documents to + // be imported. Defaults to + // [ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL]. + ReconciliationMode reconciliation_mode = 6; + + // Whether to automatically generate IDs for the documents if absent. + // + // If set to `true`, + // [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s are + // automatically generated based on the hash of the payload, where IDs may not + // be consistent during multiple imports. In which case + // [ReconciliationMode.FULL][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode.FULL] + // is highly recommended to avoid duplicate contents. If unset or set to + // `false`, [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s + // have to be specified using + // [id_field][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.id_field], + // otherwise, documents without IDs fail to be imported. + // + // Only set this field when using + // [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] or + // [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource], and + // when + // [GcsSource.data_schema][google.cloud.discoveryengine.v1alpha.GcsSource.data_schema] + // or + // [BigQuerySource.data_schema][google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema] + // is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + bool auto_generate_ids = 8; + + // The field in the Cloud Storage and BigQuery sources that indicates the + // unique IDs of the documents. + // + // For [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] it is the + // key of the JSON field. For instance, `my_id` for JSON `{"my_id": + // "some_uuid"}`. For + // [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource] it is + // the column name of the BigQuery table where the unique ids are stored. + // + // The values of the JSON field or the BigQuery column are used as the + // [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s. The JSON + // field or the BigQuery column must be of string type, and the values must be + // set as valid strings conform to + // [RFC-1034](https://tools.ietf.org/html/rfc1034) with 1-63 characters. + // Otherwise, documents without valid IDs fail to be imported. + // + // Only set this field when using + // [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] or + // [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource], and + // when + // [GcsSource.data_schema][google.cloud.discoveryengine.v1alpha.GcsSource.data_schema] + // or + // [BigQuerySource.data_schema][google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema] + // is `custom`. And only set this field when + // [auto_generate_ids][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.auto_generate_ids] + // is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown. + // + // If it is unset, a default value `_id` is used when importing from the + // allowed data sources. + string id_field = 9; +} + +// Response of the +// [ImportDocumentsRequest][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest]. +// 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 ImportDocumentsResponse { + // 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. + ImportErrorConfig error_config = 2; +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/purge_config.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/purge_config.proto new file mode 100644 index 000000000000..ae6158bf2a7d --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/purge_config.proto @@ -0,0 +1,159 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.discoveryengine.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "PurgeConfigProto"; +option java_package = "com.google.cloud.discoveryengine.v1alpha"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha"; + +// 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/collections/{$collectionId}/dataStores/${dataStoreId}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/DataStore" + } + ]; + + // Required. The filter string to specify the events to be deleted with a + // length limit of 5,000 characters. The eligible fields for filtering are: + // + // * `eventType`: Double quoted + // [UserEvent.event_type][google.cloud.discoveryengine.v1alpha.UserEvent.event_type] + // string. + // * `eventTime`: in ISO 8601 "zulu" format. + // * `userPseudoId`: 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: + // `eventType = "search"` + // * Deleting all events for a specific visitor: + // `userPseudoId = "visitor1024"` + // * Deleting all events inside a DataStore: + // `*` + // + // The filtering fields are assumed to have an implicit AND. + string filter = 2 [(google.api.field_behavior) = REQUIRED]; + + // The `force` field is currently not supported. Purge user event requests + // will permanently delete all purgeable events. Once the development is + // complete: + // If `force` is set to false, the method will return the expected + // purge count without deleting any user events. This field will default to + // false if not included in the request. + 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 purge_count = 1; +} + +// Metadata related to the progress of the PurgeUserEvents operation. +// This will be returned by the google.longrunning.Operation.metadata field. +message PurgeUserEventsMetadata { + // 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 +// [DocumentService.PurgeDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.PurgeDocuments] +// method. +message PurgeDocumentsRequest { + // Required. The parent resource name, such as + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Branch" + } + ]; + + // Required. Filter matching documents to purge. Only currently supported + // value is + // `*` (all items). + string filter = 2 [(google.api.field_behavior) = REQUIRED]; + + // Actually performs the purge. If `force` is set to false, return the + // expected purge count without deleting any documents. + bool force = 3; +} + +// Response message for +// [DocumentService.PurgeDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.PurgeDocuments] +// method. If the long running operation is successfully done, then this message +// is returned by the google.longrunning.Operations.response field. +message PurgeDocumentsResponse { + // The total count of documents purged as a result of the operation. + int64 purge_count = 1; + + // A sample of document 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: "discoveryengine.googleapis.com/Document" + }]; +} + +// Metadata related to the progress of the PurgeDocuments operation. +// This will be returned by the google.longrunning.Operation.metadata field. +message PurgeDocumentsMetadata { + // 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; +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/recommendation_service.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/recommendation_service.proto new file mode 100644 index 000000000000..65206827606c --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/recommendation_service.proto @@ -0,0 +1,221 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.discoveryengine.v1alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/discoveryengine/v1alpha/document.proto"; +import "google/cloud/discoveryengine/v1alpha/user_event.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "RecommendationServiceProto"; +option java_package = "com.google.cloud.discoveryengine.v1alpha"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha"; + +// Service for making recommendations. +service RecommendationService { + option (google.api.default_host) = "discoveryengine.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Makes a recommendation, which requires a contextual user event. + rpc Recommend(RecommendRequest) returns (RecommendResponse) { + option (google.api.http) = { + post: "/v1alpha/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:recommend" + body: "*" + additional_bindings { + post: "/v1alpha/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:recommend" + body: "*" + } + additional_bindings { + post: "/v1alpha/{serving_config=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:recommend" + body: "*" + } + }; + } +} + +// Request message for Recommend method. +message RecommendRequest { + // Required. Full resource name of the format: + // `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` + // + // Before you can request recommendations from your model, you must create at + // least one serving config for it. + string serving_config = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/ServingConfig" + } + ]; + + // Required. Context about the user, what they are looking at and what action + // they took to trigger the Recommend 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. + // + // Don't set + // [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id] + // or + // [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id] + // to the same fixed ID for different users. If you are trying to receive + // non-personalized recommendations (not recommended; this can negatively + // impact model performance), instead set + // [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id] + // to a random unique ID and leave + // [UserEvent.user_info.user_id][google.cloud.discoveryengine.v1alpha.UserInfo.user_id] + // unset. + UserEvent user_event = 2 [(google.api.field_behavior) = REQUIRED]; + + // Maximum number of results to return. Set this property + // to the number of recommendation 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; + + // Filter for restricting recommendation results with a length limit of 5,000 + // characters. Currently, only filter expressions on the `filter_tags` + // attribute is supported. + // + // + // Examples: + // + // * `(filter_tags: ANY("Red", "Blue") OR filter_tags: ANY("Hot", "Cold"))` + // * `(filter_tags: ANY("Red", "Blue")) AND NOT (filter_tags: ANY("Green"))` + // + // If `attributeFilteringSyntax` is set to true under the `params` field, then + // attribute-based expressions are expected instead of the above described + // tag-based syntax. Examples: + // + // * (launguage: ANY("en", "es")) AND NOT (categories: ANY("Movie")) + // * (available: true) AND + // (launguage: ANY("en", "es")) OR (categories: ANY("Movie")) + // + // If your filter blocks all results, the API will return generic + // (unfiltered) popular Documents. If you only want results strictly matching + // the filters, set `strictFiltering` to True in + // [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params] + // to receive empty results instead. + // + // Note that the API will never return + // [Document][google.cloud.discoveryengine.v1alpha.Document]s with + // `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices. + string filter = 4; + + // Use validate only mode for this recommendation query. If set to true, a + // fake model will be used that returns arbitrary Document IDs. + // Note that the validate only mode should only be used for testing the API, + // or if the model is not ready. + bool validate_only = 5; + + // Additional domain specific parameters for the recommendations. + // + // Allowed values: + // + // * `returnDocument`: Boolean. If set to true, the associated Document + // object will be returned in + // [RecommendResponse.RecommendationResult.document][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.document]. + // * `returnScore`: Boolean. If set to true, the recommendation 'score' + // corresponding to each returned Document will be set in + // [RecommendResponse.RecommendationResult.metadata][google.cloud.discoveryengine.v1alpha.RecommendResponse.RecommendationResult.metadata]. + // The given 'score' indicates the probability of a Document conversion + // given the user's context and history. + // * `strictFiltering`: Boolean. True by default. If set to false, the service + // will return generic (unfiltered) popular Documents instead of empty if + // your filter blocks all recommendation results. + // * `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 recommendation results + // based on Document category. + // * `attributeFilteringSyntax`: Boolean. False by default. If set to true, + // the `filter` field is interpreted according to the new, + // attribute-based syntax. + map params = 6; + + // The user 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 [Requirements for + // labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + // for more details. + map user_labels = 8; +} + +// Response message for Recommend method. +message RecommendResponse { + // RecommendationResult represents a generic recommendation result with + // associated metadata. + message RecommendationResult { + // Resource ID of the recommended Document. + string id = 1; + + // Set if `returnDocument` is set to true in + // [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params]. + Document document = 2; + + // Additional Document metadata / annotations. + // + // Possible values: + // + // * `score`: Recommendation score in double value. Is set if + // `returnScore` is set to true in + // [RecommendRequest.params][google.cloud.discoveryengine.v1alpha.RecommendRequest.params]. + map metadata = 3; + } + + // A list of recommended Documents. The order represents the ranking (from the + // most relevant Document to the least). + repeated RecommendationResult results = 1; + + // A unique attribution token. This should be included in the + // [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] logs resulting + // from this recommendation, which enables accurate attribution of + // recommendation model performance. + string attribution_token = 2; + + // IDs of documents in the request that were missing from the default Branch + // associated with the requested ServingConfig. + repeated string missing_ids = 3; + + // True if + // [RecommendRequest.validate_only][google.cloud.discoveryengine.v1alpha.RecommendRequest.validate_only] + // was set. + bool validate_only = 4; +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/schema.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/schema.proto new file mode 100644 index 000000000000..1c073962aa4d --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/schema.proto @@ -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 +// +// 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.discoveryengine.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "SchemaProto"; +option java_package = "com.google.cloud.discoveryengine.v1alpha"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha"; + +// Defines the structure and layout of a type of document data. +message Schema { + option (google.api.resource) = { + type: "discoveryengine.googleapis.com/Schema" + pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}" + pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}" + }; + + // Schema representation. One of + // [struct_schema][google.cloud.discoveryengine.v1alpha.Schema.struct_schema] + // or [json_schema][google.cloud.discoveryengine.v1alpha.Schema.json_schema] + // should be provided otherwise an `INVALID_ARGUMENT` error is thrown. + oneof schema { + // The structured representation of the schema. + google.protobuf.Struct struct_schema = 2; + + // The JSON representation of the schema. + string json_schema = 3; + } + + // Immutable. The full resource name of the schema, in the format of + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. + // + // This field must be a UTF-8 encoded string with a length limit of 1024 + // characters. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. Configurations for fields of the schema. + repeated FieldConfig field_configs = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Configurations for fields of a schema. For example, configuring a field is +// indexable, or searchable. +message FieldConfig { + // Field value type in the Schema. + enum FieldType { + // Field type is unspecified. + FIELD_TYPE_UNSPECIFIED = 0; + + // Field value type is Object. + OBJECT = 1; + + // Field value type is String. + STRING = 2; + + // Field value type is Number. + NUMBER = 3; + + // Field value type is Integer. + INTEGER = 4; + + // Field value type is Boolean. + BOOLEAN = 5; + + // Field value type is Geolocation. + GEOLOCATION = 6; + } + + // The setting of Indexable options in schema. + enum IndexableOption { + // Value used when unset. + INDEXABLE_OPTION_UNSPECIFIED = 0; + + // Indexable option enabled for a schema field. + INDEXABLE_ENABLED = 1; + + // Indexable option disabled for a schema field. + INDEXABLE_DISABLED = 2; + } + + // The status of the dynamic facetable option of a schema field. + enum DynamicFacetableOption { + // Value used when unset. + DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0; + + // Dynamic facetable option enabled for a schema field. + DYNAMIC_FACETABLE_ENABLED = 1; + + // Dynamic facetable option disabled for a schema field. + DYNAMIC_FACETABLE_DISABLED = 2; + } + + // The setting of Searchable options in schema. + enum SearchableOption { + // Value used when unset. + SEARCHABLE_OPTION_UNSPECIFIED = 0; + + // Searchable option enabled for a schema field. + SEARCHABLE_ENABLED = 1; + + // Searchable option disabled for a schema field. + SEARCHABLE_DISABLED = 2; + } + + // The setting of Retrievable options in schema. + enum RetrievableOption { + // Value used when unset. + RETRIEVABLE_OPTION_UNSPECIFIED = 0; + + // Retrievable option enabled for a schema field. + RETRIEVABLE_ENABLED = 1; + + // Retrievable option disabled for a schema field. + RETRIEVABLE_DISABLED = 2; + } + + // The setting of Completable options in schema. + enum CompletableOption { + // Value used when unset. + COMPLETABLE_OPTION_UNSPECIFIED = 0; + + // Completable option enabled for a schema field. + COMPLETABLE_ENABLED = 1; + + // Completable option disabled for a schema field. + COMPLETABLE_DISABLED = 2; + } + + // Sets the filterable option for schema fields. + enum FilterableOption { + // Value used when unset. + FILTERABLE_OPTION_UNSPECIFIED = 0; + + // Filterable option enabled for a schema field. + FILTERABLE_ENABLED = 1; + + // Filterable option disabled for a schema field. + FILTERABLE_DISABLED = 2; + } + + // Required. Field path of the schema field. + // For example: `title`, `description`, `release_info.release_year`. + string field_path = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Raw type of the field. + FieldType field_type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // If + // [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option] + // is + // [INDEXABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_ENABLED], + // field values are indexed so that it can be filtered or faceted in + // [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]. + // + // If + // [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option] + // is unset, the server behavior defaults to + // [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED] + // for fields that support setting indexable options. For those fields that do + // not support setting indexable options, such as `object` and `boolean` and + // key properties, the server will skip + // [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option] + // setting, and setting + // [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option] + // for those fields will throw `INVALID_ARGUMENT` error. + IndexableOption indexable_option = 3; + + // If + // [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option] + // is + // [DYNAMIC_FACETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED], + // field values are available for dynamic facet. Could only be + // [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED] + // if + // [FieldConfig.indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option] + // is + // [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED]. + // Otherwise, an `INVALID_ARGUMENT` error will be returned. + // + // If + // [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option] + // is unset, the server behavior defaults to + // [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED] + // for fields that support setting dynamic facetable options. For those fields + // that do not support setting dynamic facetable options, such as `object` and + // `boolean`, the server will skip dynamic facetable option setting, and + // setting + // [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option] + // for those fields will throw `INVALID_ARGUMENT` error. + DynamicFacetableOption dynamic_facetable_option = 4; + + // If + // [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option] + // is + // [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED], + // field values are searchable by text queries in + // [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]. + // + // If + // [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED] + // but field type is numerical, field values will not be searchable by text + // queries in + // [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search], + // as there are no text values associated to numerical fields. + // + // If + // [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option] + // is unset, the server behavior defaults to + // [SEARCHABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_DISABLED] + // for fields that support setting searchable options. Only `string` fields + // that have no key property mapping support setting + // [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option]. + // + // For those fields that do not support setting searchable options, the server + // will skip searchable option setting, and setting + // [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option] + // for those fields will throw `INVALID_ARGUMENT` error. + SearchableOption searchable_option = 5; + + // If + // [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option] + // is + // [RETRIEVABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_ENABLED], + // field values are included in the search results. + // + // If + // [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option] + // is unset, the server behavior defaults to + // [RETRIEVABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_DISABLED] + // for fields that support setting retrievable options. For those fields + // that do not support setting retrievable options, such as `object` and + // `boolean`, the server will skip retrievable option setting, and setting + // [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option] + // for those fields will throw `INVALID_ARGUMENT` error. + RetrievableOption retrievable_option = 6; + + // If + // [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option] + // is + // [COMPLETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_ENABLED], + // field values are directly used and returned as suggestions for Autocomplete + // in + // [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery]. + // + // If + // [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option] + // is unset, the server behavior defaults to + // [COMPLETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_DISABLED] + // for fields that support setting completable options, which are just + // `string` fields. For those fields that do not support setting completable + // options, the server will skip completable option setting, and setting + // [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option] + // for those fields will throw `INVALID_ARGUMENT` error. + CompletableOption completable_option = 8; + + // If + // [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option] + // is + // [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED], + // field values are filterable by filter expression in + // [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend]. + // + // If + // [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED] + // but the field type is numerical, field values are not filterable by text + // queries in + // [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend]. + // Only textual fields are supported. + // + // If + // [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option] + // is unset, the default setting is + // [FILTERABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_DISABLED] + // for fields that support setting filterable options. + // + // When a field set to [FILTERABLE_DISABLED] is filtered, a warning is + // generated and an empty result is returned. + FilterableOption recs_filterable_option = 9; + + // Output only. Type of the key property that this field is mapped to. Empty + // string if this is not annotated as mapped to a key property. + // + // Example types are `title`, `description`. Full list is defined + // by `keyPropertyMapping` in the schema field annotation. + // + // If the schema field has a `KeyPropertyMapping` annotation, + // `indexable_option` and `searchable_option` of this field cannot be + // modified. + string key_property_type = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/schema_service.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/schema_service.proto new file mode 100644 index 000000000000..9d5e4ee9936d --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/schema_service.proto @@ -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 +// +// 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.discoveryengine.v1alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/discoveryengine/v1alpha/schema.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "SchemaServiceProto"; +option java_package = "com.google.cloud.discoveryengine.v1alpha"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha"; + +// Service for managing [Schema][google.cloud.discoveryengine.v1alpha.Schema]s. +service SchemaService { + option (google.api.default_host) = "discoveryengine.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Gets a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. + rpc GetSchema(GetSchemaRequest) returns (Schema) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/dataStores/*/schemas/*}" + additional_bindings { + get: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Gets a list of [Schema][google.cloud.discoveryengine.v1alpha.Schema]s. + rpc ListSchemas(ListSchemasRequest) returns (ListSchemasResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*/dataStores/*}/schemas" + additional_bindings { + get: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*}/schemas" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. + rpc CreateSchema(CreateSchemaRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*/dataStores/*}/schemas" + body: "schema" + additional_bindings { + post: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*}/schemas" + body: "schema" + } + }; + option (google.api.method_signature) = "parent,schema,schema_id"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.discoveryengine.v1alpha.Schema" + metadata_type: "google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata" + }; + } + + // Updates a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. + rpc UpdateSchema(UpdateSchemaRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha/{schema.name=projects/*/locations/*/dataStores/*/schemas/*}" + body: "schema" + additional_bindings { + patch: "/v1alpha/{schema.name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}" + body: "schema" + } + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.discoveryengine.v1alpha.Schema" + metadata_type: "google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata" + }; + } + + // Deletes a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. + rpc DeleteSchema(DeleteSchemaRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/locations/*/dataStores/*/schemas/*}" + additional_bindings { + delete: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}" + } + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata" + }; + } +} + +// Request message for +// [SchemaService.GetSchema][google.cloud.discoveryengine.v1alpha.SchemaService.GetSchema] +// method. +message GetSchemaRequest { + // Required. The full resource name of the schema, in the format of + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Schema" + } + ]; +} + +// Request message for +// [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas] +// method. +message ListSchemasRequest { + // Required. The parent data store resource name, in the format of + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/DataStore" + } + ]; + + // The maximum number of + // [Schema][google.cloud.discoveryengine.v1alpha.Schema]s to return. The + // service may return fewer than this value. + // + // If unspecified, at most 100 + // [Schema][google.cloud.discoveryengine.v1alpha.Schema]s will be returned. + // + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous + // [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas] + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas] + // must match the call that provided the page token. + string page_token = 3; +} + +// Response message for +// [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas] +// method. +message ListSchemasResponse { + // The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s. + repeated Schema schemas = 1; + + // A token that can be sent as + // [ListSchemasRequest.page_token][google.cloud.discoveryengine.v1alpha.ListSchemasRequest.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 +// [SchemaService.CreateSchema][google.cloud.discoveryengine.v1alpha.SchemaService.CreateSchema] +// method. +message CreateSchemaRequest { + // Required. The parent data store resource name, in the format of + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/DataStore" + } + ]; + + // Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to + // create. + Schema schema = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the + // [Schema][google.cloud.discoveryengine.v1alpha.Schema], which will become + // the final component of the + // [Schema.name][google.cloud.discoveryengine.v1alpha.Schema.name]. + // + // This field should conform to + // [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length + // limit of 63 characters. + string schema_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [SchemaService.UpdateSchema][google.cloud.discoveryengine.v1alpha.SchemaService.UpdateSchema] +// method. +message UpdateSchemaRequest { + // Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to + // update. + Schema schema = 1 [(google.api.field_behavior) = REQUIRED]; + + // If set to true, and the + // [Schema][google.cloud.discoveryengine.v1alpha.Schema] is not found, a new + // [Schema][google.cloud.discoveryengine.v1alpha.Schema] will be created. In + // this situation, `update_mask` is ignored. + bool allow_missing = 3; +} + +// Request message for +// [SchemaService.DeleteSchema][google.cloud.discoveryengine.v1alpha.SchemaService.DeleteSchema] +// method. +message DeleteSchemaRequest { + // Required. The full resource name of the schema, in the format of + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Schema" + } + ]; +} + +// Metadata for Create Schema LRO. +message CreateSchemaMetadata { + // 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; +} + +// Metadata for UpdateSchema LRO. +message UpdateSchemaMetadata { + // 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; +} + +// Metadata for DeleteSchema LRO. +message DeleteSchemaMetadata { + // 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; +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/search_service.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/search_service.proto new file mode 100644 index 000000000000..4021b8484b49 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/search_service.proto @@ -0,0 +1,851 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.discoveryengine.v1alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/discoveryengine/v1alpha/common.proto"; +import "google/cloud/discoveryengine/v1alpha/document.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "SearchServiceProto"; +option java_package = "com.google.cloud.discoveryengine.v1alpha"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha"; + +// Service for search. +service SearchService { + option (google.api.default_host) = "discoveryengine.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Performs a search. + rpc Search(SearchRequest) returns (SearchResponse) { + option (google.api.http) = { + post: "/v1alpha/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:search" + body: "*" + additional_bindings { + post: "/v1alpha/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:search" + body: "*" + } + additional_bindings { + post: "/v1alpha/{serving_config=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:search" + body: "*" + } + }; + } +} + +// Request message for +// [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search] +// method. +message SearchRequest { + // Specifies the image query input. + message ImageQuery { + oneof image { + // Base64 encoded image bytes. Supported image formats: JPEG, PNG, and + // BMP. + string image_bytes = 1; + } + } + + // 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 + // [Document][google.cloud.discoveryengine.v1alpha.Document] object, over + // which the facet values are computed. Facet key is case-sensitive. + string key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Set only if values should be bucketed 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. Only supported on + // textual fields. For example, suppose "category" has three values + // "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set + // "restricted_values" to "Action > 2022", the "category" facet only + // contains "Action > 2022". Only supported on textual fields. Maximum + // is 10. + repeated string restricted_values = 3; + + // Only get facet values that start with the given string prefix. For + // example, suppose "category" has three values "Action > 2022", + // "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the + // "category" facet only contains "Action > 2022" and "Action > 2021". + // Only supported on textual fields. Maximum is 10. + repeated string prefixes = 4; + + // Only get facet values that contains the given strings. For example, + // suppose "category" has three values "Action > 2022", + // "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the + // "category" facet only contains "Action > 2022" and "Sci-Fi > 2022". + // Only supported on textual fields. Maximum is 10. + repeated string contains = 5; + + // True to make facet keys case insensitive when getting faceting + // values with prefixes or contains; false otherwise. + bool case_insensitive = 6; + + // The order in which documents are returned. + // + // Allowed values are: + // + // * "count desc", which means order by + // [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1alpha.SearchResponse.Facet.FacetValue.count] + // descending. + // + // * "value desc", which means order by + // [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1alpha.SearchResponse.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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals]. + string order_by = 7; + } + + // 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 are 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.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key] + // is not excluded from the filter unless it is listed in this field. + // + // Listing a facet key in this field allows its values to appear as facet + // results, even when they are filtered out of search results. Using this + // field does not affect what search results are returned. + // + // For example, suppose there are 100 documents with the color facet "Red" + // and 200 documents with the color facet "Blue". A query containing the + // filter "color:ANY("Red")" and having "color" as + // [FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key] + // would by default return only "Red" documents in the search results, and + // also return "Red" with count 100 as the only color facet. Although there + // are also blue documents available, "Blue" would not be shown as an + // available facet value. + // + // If "color" is listed in "excludedFilterKeys", then the query returns the + // facet values "Red" with count 100 and "Blue" with count 200, because the + // "color" key is now excluded from the filter. Because this field doesn't + // affect search results, the search results are still correctly filtered to + // return only "Red" documents. + // + // 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 automatically. + // If dynamic facets are enabled, it is ordered together. + // If set to false, the position of this facet in the + // response is the same as in the request, and it is 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 is determined + // automatically. + // + // 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 enabled, which generates 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 API orders "gender" and "rating" facets. + // However, notice that "price" and "brands" are always + // ranked at first and second position because their enable_dynamic_position + // is false. + bool enable_dynamic_position = 4; + } + + // Boost specification to boost certain documents. + message BoostSpec { + // Boost applies to documents 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.discoveryengine.v1alpha.SearchRequest.filter] + // for detail syntax and limitations. + // + // Examples: + // + // * To boost documents with document ID "doc_1" or "doc_2", and + // color + // "Red" or "Blue": + // * (id: ANY("doc_1", "doc_2")) AND (color: 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 document a big promotion. However, it does not + // necessarily mean that the boosted document will be the top result at + // all times, nor that other documents 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 documents. + // + // Setting to -1.0 gives the document a big demotion. However, results + // that are deeply relevant might still be shown. The document 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 document 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 20. + repeated ConditionBoostSpec condition_boost_specs = 1; + } + + // 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. In this case, server behavior + // defaults to + // [Condition.DISABLED][google.cloud.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. + CONDITION_UNSPECIFIED = 0; + + // Disabled query expansion. Only the exact search query is used, even if + // [SearchResponse.total_size][google.cloud.discoveryengine.v1alpha.SearchResponse.total_size] + // is zero. + DISABLED = 1; + + // Automatic query expansion built by the Search API. + AUTO = 2; + } + + // The condition under which query expansion should occur. Default to + // [Condition.DISABLED][google.cloud.discoveryengine.v1alpha.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 query spell correction. + message SpellCorrectionSpec { + // Enum describing under which mode spell correction should occur. + enum Mode { + // Unspecified spell correction mode. In this case, server behavior + // defaults to + // [Mode.AUTO][google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode.AUTO]. + MODE_UNSPECIFIED = 0; + + // Search API will try to find a spell suggestion if there + // is any and put in the + // [SearchResponse.corrected_query][google.cloud.discoveryengine.v1alpha.SearchResponse.corrected_query]. + // The spell suggestion will not be used as the search query. + SUGGESTION_ONLY = 1; + + // Automatic spell correction built by the Search API. Search will + // be based on the corrected query if found. + AUTO = 2; + } + + // The mode under which spell correction should take effect to + // replace the original search query. Default to + // [Mode.AUTO][google.cloud.discoveryengine.v1alpha.SearchRequest.SpellCorrectionSpec.Mode.AUTO]. + Mode mode = 1; + } + + // A specification for configuring the behavior of content search. + message ContentSearchSpec { + // A specification for configuring snippets in a search response. + message SnippetSpec { + // [DEPRECATED] This field is deprecated. To control snippet return, use + // `return_snippet` field. For backwards compatibility, we will return + // snippet if max_snippet_count > 0. + int32 max_snippet_count = 1 [deprecated = true]; + + // [DEPRECATED] This field is deprecated and will have no affect on the + // snippet. + bool reference_only = 2 [deprecated = true]; + + // If `true`, then return snippet. If no snippet can be generated, we + // return "No snippet is available for this page." A `snippet_status` with + // `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned. + bool return_snippet = 3; + } + + // A specification for configuring a summary returned in a search + // response. + message SummarySpec { + // The number of top results to generate the summary from. If the number + // of results returned is less than `summaryResultCount`, the summary is + // generated from all of the results. + // + // At most five results can be used to generate a summary. + int32 summary_result_count = 1; + + // Specifies whether to include citations in the summary. The default + // value is `false`. + // + // When this field is set to `true`, summaries include in-line citation + // numbers. + // + // Example summary including citations: + // + // BigQuery is Google Cloud's fully managed and completely serverless + // enterprise data warehouse [1]. BigQuery supports all data types, works + // across clouds, and has built-in machine learning and business + // intelligence, all within a unified platform [2, 3]. + // + // The citation numbers refer to the returned search results and are + // 1-indexed. For example, [1] means that the sentence is attributed to + // the first search result. [2, 3] means that the sentence is attributed + // to both the second and third search results. + bool include_citations = 2; + + // Specifies whether to filter out adversarial queries. The default value + // is `false`. + // + // Google employs search-query classification to detect adversarial + // queries. No summary is returned if the search query is classified as an + // adversarial query. For example, a user might ask a question regarding + // negative comments about the company or submit a query designed to + // generate unsafe, policy-violating output. If this field is set to + // `true`, we skip generating summaries for adversarial queries and return + // fallback messages instead. + bool ignore_adversarial_query = 3; + + // Specifies whether to filter out queries that are not summary-seeking. + // The default value is `false`. + // + // Google employs search-query classification to detect summary-seeking + // queries. No summary is returned if the search query is classified as a + // non-summary seeking query. For example, `why is the sky blue` and `Who + // is the best soccer player in the world?` are summary-seeking queries, + // but `SFO airport` and `world cup 2026` are not. They are most likely + // navigational queries. If this field is set to `true`, we skip + // generating summaries for non-summary seeking queries and return + // fallback messages instead. + bool ignore_non_summary_seeking_query = 4; + + // Language code for Summary. Use language tags defined by + // [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + // Note: This is an experimental feature. + string language_code = 6; + } + + // A specification for configuring the extractive content in a search + // response. + message ExtractiveContentSpec { + // The maximum number of extractive answers returned in each search + // result. + // + // An extractive answer is a verbatim answer extracted from the original + // document, which provides a precise and contextually relevant answer to + // the search query. + // + // If the number of matching answers is less than the + // `max_extractive_answer_count`, return all of the answers. Otherwise, + // return the `max_extractive_answer_count`. + // + // At most one answer is returned for each + // [SearchResult][google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult]. + int32 max_extractive_answer_count = 1; + + // The max number of extractive segments returned in each search result. + // Only applied if the + // [DataStore][google.cloud.discoveryengine.v1alpha.DataStore] is set to + // [DataStore.ContentConfig.CONTENT_REQUIRED][google.cloud.discoveryengine.v1alpha.DataStore.ContentConfig.CONTENT_REQUIRED] + // or + // [DataStore.solution_types][google.cloud.discoveryengine.v1alpha.DataStore.solution_types] + // is + // [SOLUTION_TYPE_CHAT][google.cloud.discoveryengine.v1alpha.SolutionType.SOLUTION_TYPE_CHAT]. + // + // An extractive segment is a text segment extracted from the original + // document that is relevant to the search query, and, in general, more + // verbose than an extractive answer. The segment could then be used as + // input for LLMs to generate summaries and answers. + // + // If the number of matching segments is less than + // `max_extractive_segment_count`, return all of the segments. Otherwise, + // return the `max_extractive_segment_count`. + int32 max_extractive_segment_count = 2; + + // Specifies whether to return the confidence score from the extractive + // segments in each search result. The default value is `false`. + // + // Note: this is a priavte preview feature and only works for allowlisted + // users, please reach out to Cloud Support team if you want to use it. + bool return_extractive_segment_score = 3; + + // Specifies whether to also include the adjacent from each selected + // segments. + // Return at most `num_previous_segments` segments before each selected + // segments. + int32 num_previous_segments = 4; + + // Return at most `num_next_segments` segments after each selected + // segments. + int32 num_next_segments = 5; + } + + // If `snippetSpec` is not specified, snippets are not included in the + // search response. + SnippetSpec snippet_spec = 1; + + // If `summarySpec` is not specified, summaries are not included in the + // search response. + SummarySpec summary_spec = 2; + + // If there is no extractive_content_spec provided, there will be no + // extractive answer in the search response. + ExtractiveContentSpec extractive_content_spec = 3; + } + + // The specification that uses customized query embedding vector to do + // semantic document retrieval. + message EmbeddingSpec { + // Embedding vector. + message EmbeddingVector { + // Embedding field path in schema. + string field_path = 1; + + // Query embedding vector. + repeated float vector = 2; + } + + // The embedding vector used for retrieval. Limit to 1. + repeated EmbeddingVector embedding_vectors = 1; + } + + // Required. The resource name of the Search serving config, such as + // `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. + // This field is used to identify the serving configuration name, set + // of models used to make the search. + string serving_config = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/ServingConfig" + } + ]; + + // The branch resource name, such as + // `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`. + // + // Use `default_branch` as the branch ID or leave this field empty, to search + // documents under the default branch. + string branch = 2 [(google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Branch" + }]; + + // Raw search query. + string query = 3; + + // Raw image query. + ImageQuery image_query = 19; + + // Maximum number of + // [Document][google.cloud.discoveryengine.v1alpha.Document]s to return. If + // unspecified, defaults to a reasonable value. The maximum allowed value is + // 100. Values above 100 are coerced to 100. + // + // If this field is negative, an `INVALID_ARGUMENT` is returned. + int32 page_size = 4; + + // A page token received from a previous + // [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search] + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search] + // must match the call that provided the page token. Otherwise, an + // `INVALID_ARGUMENT` error is returned. + string page_token = 5; + + // A 0-indexed integer that specifies the current offset (that is, starting + // result location, amongst the + // [Document][google.cloud.discoveryengine.v1alpha.Document]s deemed by the + // API as relevant) in search results. This field is only considered if + // [page_token][google.cloud.discoveryengine.v1alpha.SearchRequest.page_token] + // is unset. + // + // If this field is negative, an `INVALID_ARGUMENT` is returned. + int32 offset = 6; + + // The filter syntax consists of an expression language for constructing a + // predicate from one or more fields of the documents being filtered. Filter + // expression is case-sensitive. + // + // If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + string filter = 7; + + // The order in which documents are returned. Documents can be ordered by + // a field in an [Document][google.cloud.discoveryengine.v1alpha.Document] + // object. Leave it unset if ordered by relevance. `order_by` expression is + // case-sensitive. + // + // If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + string order_by = 8; + + // Information about the end user. + // Highly recommended for analytics. + // [UserInfo.user_agent][google.cloud.discoveryengine.v1alpha.UserInfo.user_agent] + // is used to deduce `device_type` for analytics. + UserInfo user_info = 21; + + // 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 = 9; + + // Boost specification to boost certain documents. + BoostSpec boost_spec = 10; + + // Additional search parameters. + // + // For public website search only, supported values are: + // + // * `user_country_code`: string. Default empty. If set to non-empty, results + // are restricted or boosted based on the location provided. + // * `search_type`: double. Default empty. Enables non-webpage searching + // depending on the value. The only valid non-default value is 1, + // which enables image searching. + map params = 11; + + // The query expansion specification that specifies the conditions under which + // query expansion occurs. + QueryExpansionSpec query_expansion_spec = 13; + + // The spell correction specification that specifies the mode under + // which spell correction takes effect. + SpellCorrectionSpec spell_correction_spec = 14; + + // 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 field should NOT have a fixed value such as `unknown_visitor`. + // + // This should be the same identifier as + // [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id] + // and + // [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1alpha.CompleteQueryRequest.user_pseudo_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_pseudo_id = 15; + + // A specification for configuring the behavior of content search. + ContentSearchSpec content_search_spec = 24; + + // Uses the provided embedding to do additional semantic document retrieval. + // The retrieval is based on the dot product of + // [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document + // embedding that is provided in + // [SearchRequest.embedding_spec.embedding_vectors.field_path][]. + // + // If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not + // provided, it will use [ServingConfig.embedding_config.field_paths][]. + EmbeddingSpec embedding_spec = 23; + + // The ranking expression controls the customized ranking on retrieval + // documents. This overrides + // [ServingConfig.ranking_expression][google.cloud.discoveryengine.v1alpha.ServingConfig.ranking_expression]. + // The ranking expression is a single function or multiple functions that are + // joint by "+". + // * ranking_expression = function, { " + ", function }; + // Supported functions: + // * double * relevance_score + // * double * dotProduct(embedding_field_path) + // Function variables: + // `relevance_score`: pre-defined keywords, used for measure relevance + // between query and document. + // `embedding_field_path`: the document embedding field + // used with query embedding vector. + // `dotProduct`: embedding function between embedding_field_path and query + // embedding vector. + // + // Example ranking expression: + // If document has an embedding field doc_embedding, the ranking expression + // could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`. + string ranking_expression = 26; + + // Whether to turn on safe search. This is only supported for + // website search. + bool safe_search = 20; + + // The user 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 user_labels = 22; +} + +// Response message for +// [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search] +// method. +message SearchResponse { + // Represents the search results. + message SearchResult { + // [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] of the + // searched [Document][google.cloud.discoveryengine.v1alpha.Document]. + string id = 1; + + // The document data snippet in the search response. Only fields that are + // marked as retrievable are populated. + Document document = 2; + + // Google provided available scores. + map model_scores = 4; + } + + // 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 "colors". + string value = 1; + + // Interval value for a facet, such as [10, 20) for facet "price". It + // matches + // [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.intervals]. + Interval interval = 2; + } + + // Number of items that have this facet value. + int64 count = 3; + } + + // The key for this facet. E.g., "colors" or "price". It matches + // [SearchRequest.FacetSpec.FacetKey.key][google.cloud.discoveryengine.v1alpha.SearchRequest.FacetSpec.FacetKey.key]. + string key = 1; + + // The facet values for this field. + repeated FacetValue values = 2; + + // Whether the facet is dynamically generated. + bool dynamic_facet = 3; + } + + // Guided search result. The guided search helps user to refine the search + // results and narrow down to the real needs from a broaded search results. + message GuidedSearchResult { + // Useful attribute for search result refinements. + message RefinementAttribute { + // Attribute key used to refine the results e.g. 'movie_type'. + string attribute_key = 1; + + // Attribute value used to refine the results e.g. 'drama'. + string attribute_value = 2; + } + + // A list of ranked refinement attributes. + repeated RefinementAttribute refinement_attributes = 1; + + // Suggested follow-up questions. + repeated string follow_up_questions = 2; + } + + // Summary of the top N search result specified by the summary spec. + message Summary { + // Safety Attribute categories and their associated confidence scores. + message SafetyAttributes { + // The display names of Safety Attribute categories associated with the + // generated content. Order matches the Scores. + repeated string categories = 1; + + // The confidence scores of the each category, higher + // value means higher confidence. Order matches the Categories. + repeated float scores = 2; + } + + // An Enum for summary-skipped reasons. + enum SummarySkippedReason { + // Default value. The summary skipped reason is not specified. + SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0; + + // The adversarial query ignored case. + // + // Only populated when + // [SummarySpec.ignore_adversarial_query][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec.ignore_adversarial_query] + // is set to `true`. + ADVERSARIAL_QUERY_IGNORED = 1; + + // The non-summary seeking query ignored case. + // + // Only populated when + // [SummarySpec.ignore_non_summary_seeking_query][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_summary_seeking_query] + // is set to `true`. + NON_SUMMARY_SEEKING_QUERY_IGNORED = 2; + + // The out-of-domain query ignored case. + // + // Google skips the summary if there are no high-relevance search results. + // For example, the data store contains facts about company A but the + // user query is asking questions about company B. + OUT_OF_DOMAIN_QUERY_IGNORED = 3; + + // The potential policy violation case. + // + // Google skips the summary if there is a potential policy violation + // detected. This includes content that may be violent or toxic. + POTENTIAL_POLICY_VIOLATION = 4; + + // The LLM addon not enabled case. + // + // Google skips the summary if the LLM addon is not enabled. + LLM_ADDON_NOT_ENABLED = 5; + } + + // The summary content. + string summary_text = 1; + + // Additional summary-skipped reasons. This provides the reason for ignored + // cases. If nothing is skipped, this field is not set. + repeated SummarySkippedReason summary_skipped_reasons = 2; + + // A collection of Safety Attribute categories and their associated + // confidence scores. + SafetyAttributes safety_attributes = 3; + } + + // Debug information specifically related to forward geocoding issues arising + // from Geolocation Search. + message GeoSearchDebugInfo { + // The address from which forward geocoding ingestion produced issues. + string original_address_query = 1; + + // The error produced. + string error_message = 2; + } + + // 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.discoveryengine.v1alpha.SearchRequest.QueryExpansionSpec.pin_unexpanded_results] + // is set to true. + int64 pinned_result_count = 2; + } + + // A list of matched documents. The order represents the ranking. + repeated SearchResult results = 1; + + // Results of facets requested by user. + repeated Facet facets = 2; + + // Guided search result. + GuidedSearchResult guided_search_result = 8; + + // The estimated total count of matched items irrespective of pagination. The + // count of + // [results][google.cloud.discoveryengine.v1alpha.SearchResponse.results] + // returned by pagination may be less than the + // [total_size][google.cloud.discoveryengine.v1alpha.SearchResponse.total_size] + // that matches. + int32 total_size = 3; + + // A unique search token. This should be included in the + // [UserEvent][google.cloud.discoveryengine.v1alpha.UserEvent] logs resulting + // from this search, which enables accurate attribution of search model + // performance. + string attribution_token = 4; + + // The URI of a customer-defined redirect page. If redirect action is + // triggered, no search is performed, and only + // [redirect_uri][google.cloud.discoveryengine.v1alpha.SearchResponse.redirect_uri] + // and + // [attribution_token][google.cloud.discoveryengine.v1alpha.SearchResponse.attribution_token] + // are set in the response. + string redirect_uri = 12; + + // A token that can be sent as + // [SearchRequest.page_token][google.cloud.discoveryengine.v1alpha.SearchRequest.page_token] + // to retrieve the next page. If this field is omitted, there are no + // subsequent pages. + string next_page_token = 5; + + // Contains the spell corrected query, if found. If the spell correction type + // is AUTOMATIC, then the search results are based on corrected_query. + // Otherwise the original query is used for search. + string corrected_query = 7; + + // A summary as part of the search results. + // This field is only returned if + // [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.summary_spec] + // is set. + Summary summary = 9; + + // Controls applied as part of the Control service. + repeated string applied_controls = 10; + + repeated GeoSearchDebugInfo geo_search_debug_info = 16; + + // Query expansion information for the returned results. + QueryExpansionInfo query_expansion_info = 14; +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/site_search_engine_service.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/site_search_engine_service.proto new file mode 100644 index 000000000000..c73ae34c1714 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/site_search_engine_service.proto @@ -0,0 +1,152 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.discoveryengine.v1alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "SiteSearchEngineServiceProto"; +option java_package = "com.google.cloud.discoveryengine.v1alpha"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha"; + +// Service for managing site search related resources. +service SiteSearchEngineService { + option (google.api.default_host) = "discoveryengine.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Request on-demand recrawl for a list of URIs. + rpc RecrawlUris(RecrawlUrisRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{site_search_engine=projects/*/locations/*/dataStores/*/siteSearchEngine}:recrawlUris" + body: "*" + additional_bindings { + post: "/v1alpha/{site_search_engine=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}:recrawlUris" + body: "*" + } + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse" + metadata_type: "google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata" + }; + } +} + +// Request message for +// [SiteSearchEngineService.RecrawlUris][google.cloud.discoveryengine.v1alpha.SiteSearchEngineService.RecrawlUris] +// method. +message RecrawlUrisRequest { + // Required. Full resource name of the + // [SiteSearchEngine][google.cloud.discoveryengine.v1alpha.SiteSearchEngine], + // such as + // `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`. + string site_search_engine = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/SiteSearchEngine" + } + ]; + + // Required. List of URIs to crawl. At most 10K URIs are supported, otherwise + // an INVALID_ARGUMENT error is thrown. Each URI should match at least one + // [TargetSite][google.cloud.discoveryengine.v1alpha.TargetSite] in + // `site_search_engine`. + repeated string uris = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for +// [SiteSearchEngineService.RecrawlUris][google.cloud.discoveryengine.v1alpha.SiteSearchEngineService.RecrawlUris] +// method. +message RecrawlUrisResponse { + // Details about why a particular URI failed to be crawled. Each FailureInfo + // contains one FailureReason per CorpusType. + message FailureInfo { + // Details about why crawling failed for a particular CorpusType, e.g. + // DESKTOP and MOBILE crawling may fail for different reasons. + message FailureReason { + // CorpusType for the failed crawling operation. + enum CorpusType { + // Default value. + CORPUS_TYPE_UNSPECIFIED = 0; + + // Denotes a crawling attempt for the desktop version of a page. + DESKTOP = 1; + + // Denotes a crawling attempt for the mobile version of a page. + MOBILE = 2; + } + + // DESKTOP, MOBILE, or CORPUS_TYPE_UNSPECIFIED. + CorpusType corpus_type = 1; + + // Reason why the URI was not crawled. + string error_message = 2; + } + + // URI that failed to be crawled. + string uri = 1; + + // List of failure reasons by corpus type (e.g. desktop, mobile). + repeated FailureReason failure_reasons = 2; + } + + // Details for a sample of up to 10 `failed_uris`. + repeated FailureInfo failure_samples = 1; + + // URIs that were not crawled before the LRO terminated. + repeated string failed_uris = 2; +} + +// Metadata related to the progress of the +// [SiteSearchEngineService.RecrawlUris][google.cloud.discoveryengine.v1alpha.SiteSearchEngineService.RecrawlUris] +// operation. This will be returned by the google.longrunning.Operation.metadata +// field. +message RecrawlUrisMetadata { + // 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; + + // Unique URIs in the request that don't match any TargetSite in the + // DataStore, only match TargetSites that haven't been fully indexed, or match + // a TargetSite with type EXCLUDE. + repeated string invalid_uris = 3; + + // Total number of unique URIs in the request that are not in invalid_uris. + int32 valid_uris_count = 4; + + // Total number of URIs that have been crawled so far. + int32 success_count = 5; + + // Total number of URIs that have yet to be crawled. + int32 pending_count = 6; + + // Total number of URIs that were rejected due to insufficient indexing + // resources. + int32 quota_exceeded_count = 7; +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/user_event.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/user_event.proto new file mode 100644 index 000000000000..7ba96f7e27d2 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/user_event.proto @@ -0,0 +1,475 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.discoveryengine.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/discoveryengine/v1alpha/common.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "UserEventProto"; +option java_package = "com.google.cloud.discoveryengine.v1alpha"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha"; + +// UserEvent captures all metadata information Discovery Engine API needs to +// know about how end users interact with customers' website. +message UserEvent { + // Required. User event type. Allowed values are: + // + // Generic values: + // + // * `search`: Search for Documents. + // * `view-item`: Detailed page view of a Document. + // * `view-item-list`: View of a panel or ordered list of Documents. + // * `view-home-page`: View of the home page. + // * `view-category-page`: View of a category page, e.g. Home > Men > Jeans + // + // Retail-related values: + // + // * `add-to-cart`: Add an item(s) to cart, e.g. in Retail online shopping + // * `purchase`: Purchase an item(s) + // + // Media-related values: + // + // * `media-play`: Start/resume watching a video, playing a song, etc. + // * `media-complete`: Finished or stopped midway through a video, song, etc. + 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. + // + // Do not set the field to the same fixed ID for different users. This mixes + // the event history of those users together, which results in degraded model + // quality. + // + // 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 + // Analytics [Client + // ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) + // for this field. + string user_pseudo_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Only required for + // [UserEventService.ImportUserEvents][google.cloud.discoveryengine.v1alpha.UserEventService.ImportUserEvents] + // method. Timestamp of when the user event happened. + google.protobuf.Timestamp event_time = 3; + + // Information about the end user. + UserInfo user_info = 4; + + // Should set to true if the request is made directly from the end user, in + // which case the + // [UserEvent.user_info.user_agent][google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.UserEventService.CollectUserEvent]. + bool direct_user_request = 5; + + // 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 session_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 + // [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id] + // as prefix. + string session_id = 6; + + // Page metadata such as categories and other critical information for certain + // event types such as `view-category-page`. + PageInfo page_info = 7; + + // Token to attribute an API response to user action(s) to trigger the event. + // + // Highly recommended for user events that are the result of + // [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend]. + // This field enables accurate attribution of recommendation model + // performance. + // + // The value must be one of: + // + // * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token] for events that are the result of + // [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend]. + // * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1alpha.SearchResponse.attribution_token] for events that are the result of + // [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]. + // + // This token enables us to accurately attribute page view or conversion + // completion 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 + // [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token] + // as a URL parameter to product K's page. When recording events on product + // K's page, log the + // [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token] + // to this field. + string attribution_token = 8; + + // The filter syntax consists of an expression language for constructing a + // predicate from one or more fields of the documents being filtered. + // + // One example is for `search` events, the associated + // [SearchRequest][google.cloud.discoveryengine.v1alpha.SearchRequest] may + // contain a filter expression in + // [SearchRequest.filter][google.cloud.discoveryengine.v1alpha.SearchRequest.filter] + // conforming to https://google.aip.dev/160#filtering. + // + // Similarly, for `view-item-list` events that are generated from a + // [RecommendationService.RecommendRequest][], this field may be populated + // directly from [RecommendationService.RecommendRequest.filter][] conforming + // to https://google.aip.dev/160#filtering. + // + // 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 = 9; + + // List of [Document][google.cloud.discoveryengine.v1alpha.Document]s + // associated with this user event. + // + // This field is optional except for the following event types: + // + // * `view-item` + // * `add-to-cart` + // * `purchase` + // * `media-play` + // * `media-complete` + // + // In a `search` event, this field represents the documents 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 + // [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents] + // is desired. + repeated DocumentInfo documents = 10; + + // Panel metadata associated with this user event. + PanelInfo panel = 11; + + // [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search] + // details related to the event. + // + // This field should be set for `search` event. + SearchInfo search_info = 12; + + // [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery] + // 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. + CompletionInfo completion_info = 13; + + // The transaction metadata (if any) associated with this user event. + TransactionInfo transaction_info = 14; + + // 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 on the customer end. + repeated string tag_ids = 15; + + // The promotion IDs if this is an event associated with promotions. + // Currently, this field is restricted to at most one ID. + repeated string promotion_ids = 16; + + // Extra user event features to include in the recommendation model. + // These attributes must NOT contain data that needs to be parsed or processed + // further, e.g. JSON or other encodings. + // + // 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 Discovery Engine 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 = 17; + + // Media-specific info. + MediaInfo media_info = 18; +} + +// Detailed page information. +message PageInfo { + // 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 `pageview_id` 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 pageview_id = 1; + + // The most specific category 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: + // `"pageCategory" : "Sales > 2017 Black Friday Deals"`. + // + // Required for `view-category-page` events. Other event types should not set + // this field. Otherwise, an `INVALID_ARGUMENT` error is returned. + string page_category = 2; + + // 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 = 3; + + // 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. However, some browser + // privacy restrictions may cause this field to be empty. + string referrer_uri = 4; +} + +// Detailed search information. +message SearchInfo { + // The user's search query. + // + // See + // [SearchRequest.query][google.cloud.discoveryengine.v1alpha.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.discoveryengine.v1alpha.SearchInfo.search_query] + // or + // [PageInfo.page_category][google.cloud.discoveryengine.v1alpha.PageInfo.page_category] + // is required for `search` events. Other event types should not set this + // field. Otherwise, an `INVALID_ARGUMENT` error is returned. + string search_query = 1; + + // The order in which products are returned, if applicable. + // + // See + // [SearchRequest.order_by][google.cloud.discoveryengine.v1alpha.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 = 2; + + // 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.discoveryengine.v1alpha.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. + optional int32 offset = 3; +} + +// Detailed completion information including completion attribution token and +// clicked completion info. +message CompletionInfo { + // End user selected + // [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.suggestion]. + string selected_suggestion = 1; + + // End user selected + // [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.suggestion] + // position, starting from 0. + int32 selected_position = 2; +} + +// A transaction represents the entire purchase transaction. +message TransactionInfo { + // Required. Total non-zero value associated with the transaction. This value + // may include shipping, tax, or other adjustments to the total value that you + // want to include. + optional float value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Currency code. Use three-character ISO-4217 code. + string currency = 2 [(google.api.field_behavior) = REQUIRED]; + + // The transaction ID with a length limit of 128 characters. + string transaction_id = 3; + + // All the taxes associated with the transaction. + optional float tax = 4; + + // 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 = + // [value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] - + // [tax][google.cloud.discoveryengine.v1alpha.TransactionInfo.tax] - + // [cost][google.cloud.discoveryengine.v1alpha.TransactionInfo.cost] + optional float cost = 5; + + // The total discount(s) value applied to this transaction. + // This figure should be excluded from + // [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] + // + // For example, if a user paid + // [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] + // amount, then nominal (pre-discount) value of the transaction is the sum of + // [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] + // and + // [TransactionInfo.discount_value][google.cloud.discoveryengine.v1alpha.TransactionInfo.discount_value] + // + // This means that profit is calculated the same way, regardless of the + // discount value, and that + // [TransactionInfo.discount_value][google.cloud.discoveryengine.v1alpha.TransactionInfo.discount_value] + // can be larger than + // [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]: + // + // * Profit = + // [value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] - + // [tax][google.cloud.discoveryengine.v1alpha.TransactionInfo.tax] - + // [cost][google.cloud.discoveryengine.v1alpha.TransactionInfo.cost] + optional float discount_value = 6; +} + +// Detailed document information associated with a user event. +message DocumentInfo { + // A required descriptor of the associated + // [Document][google.cloud.discoveryengine.v1alpha.Document]. + // + // * If [id][google.cloud.discoveryengine.v1alpha.DocumentInfo.id] is + // specified, then the default values for + // `{location}`, `{collection_id}`, `{data_store_id}`, and `{branch_id}` are + // used when annotating with the stored Document. + // + // * If [name][google.cloud.discoveryengine.v1alpha.DocumentInfo.name] is + // specified, then the provided values (default values allowed) for + // `{location}`, `{collection_id}`, `{data_store_id}`, and + // `{branch_id}` are used when annotating with the stored Document. + oneof document_descriptor { + // The [Document][google.cloud.discoveryengine.v1alpha.Document] resource + // ID. + string id = 1; + + // The [Document][google.cloud.discoveryengine.v1alpha.Document] resource + // full name, of the form: + // `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}` + string name = 2 [(google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Document" + }]; + + // The [Document][google.cloud.discoveryengine.v1alpha.Document] URI - only + // allowed for website data stores. + string uri = 6; + } + + // Quantity of the Document associated with the user event. Defaults to 1. + // + // For example, this field will be 2 if two quantities of the same Document + // are involved in a `add-to-cart` event. + // + // Required for events of the following event types: + // + // * `add-to-cart` + // * `purchase` + optional int32 quantity = 3; + + // The promotion IDs associated with this Document. + // Currently, this field is restricted to at most one ID. + repeated string promotion_ids = 4; +} + +// Detailed panel information associated with a user event. +message PanelInfo { + // Required. The panel ID. + string panel_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // The display name of the panel. + string display_name = 3; + + // The ordered position of the panel, if shown to the user with other panels. + // If set, then + // [total_panels][google.cloud.discoveryengine.v1alpha.PanelInfo.total_panels] + // must also be set. + optional int32 panel_position = 4; + + // The total number of panels, including this one, shown to the user. + // Must be set if + // [panel_position][google.cloud.discoveryengine.v1alpha.PanelInfo.panel_position] + // is set. + optional int32 total_panels = 5; +} + +// Media-specific user event information. +message MediaInfo { + // The media progress time in seconds, if applicable. + // For example, if the end user has finished 90 seconds of a playback video, + // then + // [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds] + // should be set to 90. + google.protobuf.Duration media_progress_duration = 1; + + // Media progress should be computed using only the + // [media_progress_duration][google.cloud.discoveryengine.v1alpha.MediaInfo.media_progress_duration] + // relative to the media total length. + // + // This value must be between `[0, 1.0]` inclusive. + // + // If this is not a playback or the progress cannot be computed (e.g. ongoing + // livestream), this field should be unset. + optional float media_progress_percentage = 2; +} diff --git a/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/user_event_service.proto b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/user_event_service.proto new file mode 100644 index 000000000000..9919d67fcd89 --- /dev/null +++ b/java-discoveryengine/proto-google-cloud-discoveryengine-v1alpha/src/main/proto/google/cloud/discoveryengine/v1alpha/user_event_service.proto @@ -0,0 +1,154 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.discoveryengine.v1alpha; + +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/discoveryengine/v1alpha/import_config.proto"; +import "google/cloud/discoveryengine/v1alpha/purge_config.proto"; +import "google/cloud/discoveryengine/v1alpha/user_event.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "UserEventServiceProto"; +option java_package = "com.google.cloud.discoveryengine.v1alpha"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha"; + +// Service for ingesting end user actions on a website to Discovery Engine API. +service UserEventService { + option (google.api.default_host) = "discoveryengine.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: "/v1alpha/{parent=projects/*/locations/*/dataStores/*}/userEvents:write" + body: "user_event" + additional_bindings { + post: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*}/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 third-party domain. + // + // This method is used only by the Discovery Engine 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: "/v1alpha/{parent=projects/*/locations/*/dataStores/*}/userEvents:collect" + additional_bindings { + get: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*}/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: "/v1alpha/{parent=projects/*/locations/*/dataStores/*}/userEvents:purge" + body: "*" + additional_bindings { + post: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:purge" + body: "*" + } + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse" + metadata_type: "google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata" + }; + } + + // 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: "/v1alpha/{parent=projects/*/locations/*/dataStores/*}/userEvents:import" + body: "*" + additional_bindings { + post: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:import" + body: "*" + } + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse" + metadata_type: "google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata" + }; + } +} + +// Request message for WriteUserEvent method. +message WriteUserEventRequest { + // Required. The parent DataStore resource name, such as + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/DataStore" + } + ]; + + // Required. User event to write. + optional UserEvent user_event = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for CollectUserEvent method. +message CollectUserEventRequest { + // Required. The parent DataStore resource name, such as + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/DataStore" + } + ]; + + // 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 third-party + // requests. + optional 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. + optional int64 ets = 4; +} diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservice/completequery/AsyncCompleteQuery.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservice/completequery/AsyncCompleteQuery.java new file mode 100644 index 000000000000..3837443d819b --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservice/completequery/AsyncCompleteQuery.java @@ -0,0 +1,57 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_CompletionService_CompleteQuery_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest; +import com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse; +import com.google.cloud.discoveryengine.v1alpha.CompletionServiceClient; +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; + +public class AsyncCompleteQuery { + + public static void main(String[] args) throws Exception { + asyncCompleteQuery(); + } + + public static void asyncCompleteQuery() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) { + CompleteQueryRequest request = + CompleteQueryRequest.newBuilder() + .setDataStore( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setQuery("query107944136") + .setQueryModel("queryModel-184930495") + .setUserPseudoId("userPseudoId-1155274652") + .setIncludeTailSuggestions(true) + .build(); + ApiFuture future = + completionServiceClient.completeQueryCallable().futureCall(request); + // Do something. + CompleteQueryResponse response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_CompletionService_CompleteQuery_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservice/completequery/SyncCompleteQuery.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservice/completequery/SyncCompleteQuery.java new file mode 100644 index 000000000000..c3519d41329a --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservice/completequery/SyncCompleteQuery.java @@ -0,0 +1,53 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_CompletionService_CompleteQuery_sync] +import com.google.cloud.discoveryengine.v1alpha.CompleteQueryRequest; +import com.google.cloud.discoveryengine.v1alpha.CompleteQueryResponse; +import com.google.cloud.discoveryengine.v1alpha.CompletionServiceClient; +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; + +public class SyncCompleteQuery { + + public static void main(String[] args) throws Exception { + syncCompleteQuery(); + } + + public static void syncCompleteQuery() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) { + CompleteQueryRequest request = + CompleteQueryRequest.newBuilder() + .setDataStore( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setQuery("query107944136") + .setQueryModel("queryModel-184930495") + .setUserPseudoId("userPseudoId-1155274652") + .setIncludeTailSuggestions(true) + .build(); + CompleteQueryResponse response = completionServiceClient.completeQuery(request); + } + } +} +// [END discoveryengine_v1alpha_generated_CompletionService_CompleteQuery_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservice/create/SyncCreateSetCredentialsProvider.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..8b5e5a772a70 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_CompletionService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.discoveryengine.v1alpha.CompletionServiceClient; +import com.google.cloud.discoveryengine.v1alpha.CompletionServiceSettings; +import com.google.cloud.discoveryengine.v1alpha.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + CompletionServiceSettings completionServiceSettings = + CompletionServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + CompletionServiceClient completionServiceClient = + CompletionServiceClient.create(completionServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_CompletionService_Create_SetCredentialsProvider_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservice/create/SyncCreateSetCredentialsProvider1.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..6e7511b3d326 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_CompletionService_Create_SetCredentialsProvider1_sync] +import com.google.cloud.discoveryengine.v1alpha.CompletionServiceClient; +import com.google.cloud.discoveryengine.v1alpha.CompletionServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + CompletionServiceSettings completionServiceSettings = + CompletionServiceSettings.newHttpJsonBuilder().build(); + CompletionServiceClient completionServiceClient = + CompletionServiceClient.create(completionServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_CompletionService_Create_SetCredentialsProvider1_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservice/create/SyncCreateSetEndpoint.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..98bfd8788d39 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_CompletionService_Create_SetEndpoint_sync] +import com.google.cloud.discoveryengine.v1alpha.CompletionServiceClient; +import com.google.cloud.discoveryengine.v1alpha.CompletionServiceSettings; +import com.google.cloud.discoveryengine.v1alpha.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + CompletionServiceSettings completionServiceSettings = + CompletionServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + CompletionServiceClient completionServiceClient = + CompletionServiceClient.create(completionServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_CompletionService_Create_SetEndpoint_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservicesettings/completequery/SyncCompleteQuery.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservicesettings/completequery/SyncCompleteQuery.java new file mode 100644 index 000000000000..3344411c8e3f --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/completionservicesettings/completequery/SyncCompleteQuery.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_CompletionServiceSettings_CompleteQuery_sync] +import com.google.cloud.discoveryengine.v1alpha.CompletionServiceSettings; +import java.time.Duration; + +public class SyncCompleteQuery { + + public static void main(String[] args) throws Exception { + syncCompleteQuery(); + } + + public static void syncCompleteQuery() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + CompletionServiceSettings.Builder completionServiceSettingsBuilder = + CompletionServiceSettings.newBuilder(); + completionServiceSettingsBuilder + .completeQuerySettings() + .setRetrySettings( + completionServiceSettingsBuilder + .completeQuerySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CompletionServiceSettings completionServiceSettings = completionServiceSettingsBuilder.build(); + } +} +// [END discoveryengine_v1alpha_generated_CompletionServiceSettings_CompleteQuery_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/converseconversation/AsyncConverseConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/converseconversation/AsyncConverseConversation.java new file mode 100644 index 000000000000..c2adc928e7bc --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/converseconversation/AsyncConverseConversation.java @@ -0,0 +1,68 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_ConverseConversation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.Conversation; +import com.google.cloud.discoveryengine.v1alpha.ConversationName; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest; +import com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse; +import com.google.cloud.discoveryengine.v1alpha.SearchRequest; +import com.google.cloud.discoveryengine.v1alpha.ServingConfigName; +import com.google.cloud.discoveryengine.v1alpha.TextInput; +import java.util.HashMap; + +public class AsyncConverseConversation { + + public static void main(String[] args) throws Exception { + asyncConverseConversation(); + } + + public static void asyncConverseConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + ConverseConversationRequest request = + ConverseConversationRequest.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setQuery(TextInput.newBuilder().build()) + .setServingConfig( + ServingConfigName.ofProjectLocationDataStoreServingConfigName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]") + .toString()) + .setConversation(Conversation.newBuilder().build()) + .setSafeSearch(true) + .putAllUserLabels(new HashMap()) + .setSummarySpec(SearchRequest.ContentSearchSpec.SummarySpec.newBuilder().build()) + .build(); + ApiFuture future = + conversationalSearchServiceClient.converseConversationCallable().futureCall(request); + // Do something. + ConverseConversationResponse response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_ConverseConversation_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/converseconversation/SyncConverseConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/converseconversation/SyncConverseConversation.java new file mode 100644 index 000000000000..2e9d806d5a28 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/converseconversation/SyncConverseConversation.java @@ -0,0 +1,65 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_ConverseConversation_sync] +import com.google.cloud.discoveryengine.v1alpha.Conversation; +import com.google.cloud.discoveryengine.v1alpha.ConversationName; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.ConverseConversationRequest; +import com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse; +import com.google.cloud.discoveryengine.v1alpha.SearchRequest; +import com.google.cloud.discoveryengine.v1alpha.ServingConfigName; +import com.google.cloud.discoveryengine.v1alpha.TextInput; +import java.util.HashMap; + +public class SyncConverseConversation { + + public static void main(String[] args) throws Exception { + syncConverseConversation(); + } + + public static void syncConverseConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + ConverseConversationRequest request = + ConverseConversationRequest.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .setQuery(TextInput.newBuilder().build()) + .setServingConfig( + ServingConfigName.ofProjectLocationDataStoreServingConfigName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]") + .toString()) + .setConversation(Conversation.newBuilder().build()) + .setSafeSearch(true) + .putAllUserLabels(new HashMap()) + .setSummarySpec(SearchRequest.ContentSearchSpec.SummarySpec.newBuilder().build()) + .build(); + ConverseConversationResponse response = + conversationalSearchServiceClient.converseConversation(request); + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_ConverseConversation_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/converseconversation/SyncConverseConversationConversationnameTextinput.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/converseconversation/SyncConverseConversationConversationnameTextinput.java new file mode 100644 index 000000000000..96704c26cf29 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/converseconversation/SyncConverseConversationConversationnameTextinput.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_ConverseConversation_ConversationnameTextinput_sync] +import com.google.cloud.discoveryengine.v1alpha.ConversationName; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse; +import com.google.cloud.discoveryengine.v1alpha.TextInput; + +public class SyncConverseConversationConversationnameTextinput { + + public static void main(String[] args) throws Exception { + syncConverseConversationConversationnameTextinput(); + } + + public static void syncConverseConversationConversationnameTextinput() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + TextInput query = TextInput.newBuilder().build(); + ConverseConversationResponse response = + conversationalSearchServiceClient.converseConversation(name, query); + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_ConverseConversation_ConversationnameTextinput_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/converseconversation/SyncConverseConversationStringTextinput.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/converseconversation/SyncConverseConversationStringTextinput.java new file mode 100644 index 000000000000..e87efc311010 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/converseconversation/SyncConverseConversationStringTextinput.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_ConverseConversation_StringTextinput_sync] +import com.google.cloud.discoveryengine.v1alpha.ConversationName; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.ConverseConversationResponse; +import com.google.cloud.discoveryengine.v1alpha.TextInput; + +public class SyncConverseConversationStringTextinput { + + public static void main(String[] args) throws Exception { + syncConverseConversationStringTextinput(); + } + + public static void syncConverseConversationStringTextinput() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + String name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString(); + TextInput query = TextInput.newBuilder().build(); + ConverseConversationResponse response = + conversationalSearchServiceClient.converseConversation(name, query); + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_ConverseConversation_StringTextinput_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/create/SyncCreateSetCredentialsProvider.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..e88a7fb25f50 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceSettings; +import com.google.cloud.discoveryengine.v1alpha.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ConversationalSearchServiceSettings conversationalSearchServiceSettings = + ConversationalSearchServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create(conversationalSearchServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_Create_SetCredentialsProvider_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/create/SyncCreateSetCredentialsProvider1.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..7ee82e20ac0f --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_Create_SetCredentialsProvider1_sync] +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ConversationalSearchServiceSettings conversationalSearchServiceSettings = + ConversationalSearchServiceSettings.newHttpJsonBuilder().build(); + ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create(conversationalSearchServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_Create_SetCredentialsProvider1_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/create/SyncCreateSetEndpoint.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..75e9149de128 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_Create_SetEndpoint_sync] +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceSettings; +import com.google.cloud.discoveryengine.v1alpha.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ConversationalSearchServiceSettings conversationalSearchServiceSettings = + ConversationalSearchServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create(conversationalSearchServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_Create_SetEndpoint_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/createconversation/AsyncCreateConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/createconversation/AsyncCreateConversation.java new file mode 100644 index 000000000000..9fec34923b81 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/createconversation/AsyncCreateConversation.java @@ -0,0 +1,55 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_CreateConversation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.Conversation; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest; +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; + +public class AsyncCreateConversation { + + public static void main(String[] args) throws Exception { + asyncCreateConversation(); + } + + public static void asyncCreateConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + CreateConversationRequest request = + CreateConversationRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setConversation(Conversation.newBuilder().build()) + .build(); + ApiFuture future = + conversationalSearchServiceClient.createConversationCallable().futureCall(request); + // Do something. + Conversation response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_CreateConversation_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/createconversation/SyncCreateConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/createconversation/SyncCreateConversation.java new file mode 100644 index 000000000000..2aad833373fa --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/createconversation/SyncCreateConversation.java @@ -0,0 +1,51 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_CreateConversation_sync] +import com.google.cloud.discoveryengine.v1alpha.Conversation; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.CreateConversationRequest; +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; + +public class SyncCreateConversation { + + public static void main(String[] args) throws Exception { + syncCreateConversation(); + } + + public static void syncCreateConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + CreateConversationRequest request = + CreateConversationRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setConversation(Conversation.newBuilder().build()) + .build(); + Conversation response = conversationalSearchServiceClient.createConversation(request); + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_CreateConversation_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/createconversation/SyncCreateConversationDatastorenameConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/createconversation/SyncCreateConversationDatastorenameConversation.java new file mode 100644 index 000000000000..2324afd451a4 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/createconversation/SyncCreateConversationDatastorenameConversation.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_CreateConversation_DatastorenameConversation_sync] +import com.google.cloud.discoveryengine.v1alpha.Conversation; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; + +public class SyncCreateConversationDatastorenameConversation { + + public static void main(String[] args) throws Exception { + syncCreateConversationDatastorenameConversation(); + } + + public static void syncCreateConversationDatastorenameConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + Conversation conversation = Conversation.newBuilder().build(); + Conversation response = + conversationalSearchServiceClient.createConversation(parent, conversation); + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_CreateConversation_DatastorenameConversation_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/createconversation/SyncCreateConversationStringConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/createconversation/SyncCreateConversationStringConversation.java new file mode 100644 index 000000000000..68142b7cac71 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/createconversation/SyncCreateConversationStringConversation.java @@ -0,0 +1,47 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_CreateConversation_StringConversation_sync] +import com.google.cloud.discoveryengine.v1alpha.Conversation; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; + +public class SyncCreateConversationStringConversation { + + public static void main(String[] args) throws Exception { + syncCreateConversationStringConversation(); + } + + public static void syncCreateConversationStringConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + String parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString(); + Conversation conversation = Conversation.newBuilder().build(); + Conversation response = + conversationalSearchServiceClient.createConversation(parent, conversation); + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_CreateConversation_StringConversation_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/deleteconversation/AsyncDeleteConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/deleteconversation/AsyncDeleteConversation.java new file mode 100644 index 000000000000..ae388f9b18dc --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/deleteconversation/AsyncDeleteConversation.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_DeleteConversation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.ConversationName; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest; +import com.google.protobuf.Empty; + +public class AsyncDeleteConversation { + + public static void main(String[] args) throws Exception { + asyncDeleteConversation(); + } + + public static void asyncDeleteConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + DeleteConversationRequest request = + DeleteConversationRequest.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .build(); + ApiFuture future = + conversationalSearchServiceClient.deleteConversationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_DeleteConversation_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/deleteconversation/SyncDeleteConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/deleteconversation/SyncDeleteConversation.java new file mode 100644 index 000000000000..a899030844f6 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/deleteconversation/SyncDeleteConversation.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_DeleteConversation_sync] +import com.google.cloud.discoveryengine.v1alpha.ConversationName; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.DeleteConversationRequest; +import com.google.protobuf.Empty; + +public class SyncDeleteConversation { + + public static void main(String[] args) throws Exception { + syncDeleteConversation(); + } + + public static void syncDeleteConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + DeleteConversationRequest request = + DeleteConversationRequest.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .build(); + conversationalSearchServiceClient.deleteConversation(request); + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_DeleteConversation_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/deleteconversation/SyncDeleteConversationConversationname.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/deleteconversation/SyncDeleteConversationConversationname.java new file mode 100644 index 000000000000..4d5d2259ae5d --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/deleteconversation/SyncDeleteConversationConversationname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_DeleteConversation_Conversationname_sync] +import com.google.cloud.discoveryengine.v1alpha.ConversationName; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteConversationConversationname { + + public static void main(String[] args) throws Exception { + syncDeleteConversationConversationname(); + } + + public static void syncDeleteConversationConversationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + conversationalSearchServiceClient.deleteConversation(name); + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_DeleteConversation_Conversationname_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/deleteconversation/SyncDeleteConversationString.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/deleteconversation/SyncDeleteConversationString.java new file mode 100644 index 000000000000..f27b357ddbce --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/deleteconversation/SyncDeleteConversationString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_DeleteConversation_String_sync] +import com.google.cloud.discoveryengine.v1alpha.ConversationName; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteConversationString { + + public static void main(String[] args) throws Exception { + syncDeleteConversationString(); + } + + public static void syncDeleteConversationString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + String name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString(); + conversationalSearchServiceClient.deleteConversation(name); + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_DeleteConversation_String_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/getconversation/AsyncGetConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/getconversation/AsyncGetConversation.java new file mode 100644 index 000000000000..db3b55f39318 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/getconversation/AsyncGetConversation.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_GetConversation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.Conversation; +import com.google.cloud.discoveryengine.v1alpha.ConversationName; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.GetConversationRequest; + +public class AsyncGetConversation { + + public static void main(String[] args) throws Exception { + asyncGetConversation(); + } + + public static void asyncGetConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + GetConversationRequest request = + GetConversationRequest.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .build(); + ApiFuture future = + conversationalSearchServiceClient.getConversationCallable().futureCall(request); + // Do something. + Conversation response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_GetConversation_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/getconversation/SyncGetConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/getconversation/SyncGetConversation.java new file mode 100644 index 000000000000..fdebb54f2642 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/getconversation/SyncGetConversation.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_GetConversation_sync] +import com.google.cloud.discoveryengine.v1alpha.Conversation; +import com.google.cloud.discoveryengine.v1alpha.ConversationName; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.GetConversationRequest; + +public class SyncGetConversation { + + public static void main(String[] args) throws Exception { + syncGetConversation(); + } + + public static void syncGetConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + GetConversationRequest request = + GetConversationRequest.newBuilder() + .setName( + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString()) + .build(); + Conversation response = conversationalSearchServiceClient.getConversation(request); + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_GetConversation_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/getconversation/SyncGetConversationConversationname.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/getconversation/SyncGetConversationConversationname.java new file mode 100644 index 000000000000..14a424c59ea5 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/getconversation/SyncGetConversationConversationname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_GetConversation_Conversationname_sync] +import com.google.cloud.discoveryengine.v1alpha.Conversation; +import com.google.cloud.discoveryengine.v1alpha.ConversationName; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; + +public class SyncGetConversationConversationname { + + public static void main(String[] args) throws Exception { + syncGetConversationConversationname(); + } + + public static void syncGetConversationConversationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + ConversationName name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]"); + Conversation response = conversationalSearchServiceClient.getConversation(name); + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_GetConversation_Conversationname_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/getconversation/SyncGetConversationString.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/getconversation/SyncGetConversationString.java new file mode 100644 index 000000000000..ddce3e081527 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/getconversation/SyncGetConversationString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_GetConversation_String_sync] +import com.google.cloud.discoveryengine.v1alpha.Conversation; +import com.google.cloud.discoveryengine.v1alpha.ConversationName; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; + +public class SyncGetConversationString { + + public static void main(String[] args) throws Exception { + syncGetConversationString(); + } + + public static void syncGetConversationString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + String name = + ConversationName.ofProjectLocationDataStoreConversationName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[CONVERSATION]") + .toString(); + Conversation response = conversationalSearchServiceClient.getConversation(name); + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_GetConversation_String_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/listconversations/AsyncListConversations.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/listconversations/AsyncListConversations.java new file mode 100644 index 000000000000..c3d9e584dff7 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/listconversations/AsyncListConversations.java @@ -0,0 +1,60 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_ListConversations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.Conversation; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest; + +public class AsyncListConversations { + + public static void main(String[] args) throws Exception { + asyncListConversations(); + } + + public static void asyncListConversations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + ListConversationsRequest request = + ListConversationsRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + conversationalSearchServiceClient.listConversationsPagedCallable().futureCall(request); + // Do something. + for (Conversation element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_ListConversations_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/listconversations/AsyncListConversationsPaged.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/listconversations/AsyncListConversationsPaged.java new file mode 100644 index 000000000000..83e1e79bec50 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/listconversations/AsyncListConversationsPaged.java @@ -0,0 +1,68 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_ListConversations_Paged_async] +import com.google.cloud.discoveryengine.v1alpha.Conversation; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest; +import com.google.cloud.discoveryengine.v1alpha.ListConversationsResponse; +import com.google.common.base.Strings; + +public class AsyncListConversationsPaged { + + public static void main(String[] args) throws Exception { + asyncListConversationsPaged(); + } + + public static void asyncListConversationsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + ListConversationsRequest request = + ListConversationsRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListConversationsResponse response = + conversationalSearchServiceClient.listConversationsCallable().call(request); + for (Conversation element : response.getConversationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_ListConversations_Paged_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/listconversations/SyncListConversations.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/listconversations/SyncListConversations.java new file mode 100644 index 000000000000..97186512b46e --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/listconversations/SyncListConversations.java @@ -0,0 +1,57 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_ListConversations_sync] +import com.google.cloud.discoveryengine.v1alpha.Conversation; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.ListConversationsRequest; + +public class SyncListConversations { + + public static void main(String[] args) throws Exception { + syncListConversations(); + } + + public static void syncListConversations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + ListConversationsRequest request = + ListConversationsRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Conversation element : + conversationalSearchServiceClient.listConversations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_ListConversations_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/listconversations/SyncListConversationsDatastorename.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/listconversations/SyncListConversationsDatastorename.java new file mode 100644 index 000000000000..2d9de10e2d1e --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/listconversations/SyncListConversationsDatastorename.java @@ -0,0 +1,47 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_ListConversations_Datastorename_sync] +import com.google.cloud.discoveryengine.v1alpha.Conversation; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; + +public class SyncListConversationsDatastorename { + + public static void main(String[] args) throws Exception { + syncListConversationsDatastorename(); + } + + public static void syncListConversationsDatastorename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + for (Conversation element : + conversationalSearchServiceClient.listConversations(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_ListConversations_Datastorename_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/listconversations/SyncListConversationsString.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/listconversations/SyncListConversationsString.java new file mode 100644 index 000000000000..ece22916b32b --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/listconversations/SyncListConversationsString.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_ListConversations_String_sync] +import com.google.cloud.discoveryengine.v1alpha.Conversation; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; + +public class SyncListConversationsString { + + public static void main(String[] args) throws Exception { + syncListConversationsString(); + } + + public static void syncListConversationsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + String parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString(); + for (Conversation element : + conversationalSearchServiceClient.listConversations(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_ListConversations_String_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/updateconversation/AsyncUpdateConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/updateconversation/AsyncUpdateConversation.java new file mode 100644 index 000000000000..31b35dad5416 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/updateconversation/AsyncUpdateConversation.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_UpdateConversation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.Conversation; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateConversation { + + public static void main(String[] args) throws Exception { + asyncUpdateConversation(); + } + + public static void asyncUpdateConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + UpdateConversationRequest request = + UpdateConversationRequest.newBuilder() + .setConversation(Conversation.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + conversationalSearchServiceClient.updateConversationCallable().futureCall(request); + // Do something. + Conversation response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_UpdateConversation_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/updateconversation/SyncUpdateConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/updateconversation/SyncUpdateConversation.java new file mode 100644 index 000000000000..2c5563278ef5 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/updateconversation/SyncUpdateConversation.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_UpdateConversation_sync] +import com.google.cloud.discoveryengine.v1alpha.Conversation; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.UpdateConversationRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateConversation { + + public static void main(String[] args) throws Exception { + syncUpdateConversation(); + } + + public static void syncUpdateConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + UpdateConversationRequest request = + UpdateConversationRequest.newBuilder() + .setConversation(Conversation.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Conversation response = conversationalSearchServiceClient.updateConversation(request); + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_UpdateConversation_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/updateconversation/SyncUpdateConversationConversationFieldmask.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/updateconversation/SyncUpdateConversationConversationFieldmask.java new file mode 100644 index 000000000000..c3dd3c0ab884 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservice/updateconversation/SyncUpdateConversationConversationFieldmask.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchService_UpdateConversation_ConversationFieldmask_sync] +import com.google.cloud.discoveryengine.v1alpha.Conversation; +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateConversationConversationFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateConversationConversationFieldmask(); + } + + public static void syncUpdateConversationConversationFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConversationalSearchServiceClient conversationalSearchServiceClient = + ConversationalSearchServiceClient.create()) { + Conversation conversation = Conversation.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Conversation response = + conversationalSearchServiceClient.updateConversation(conversation, updateMask); + } + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchService_UpdateConversation_ConversationFieldmask_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservicesettings/converseconversation/SyncConverseConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservicesettings/converseconversation/SyncConverseConversation.java new file mode 100644 index 000000000000..3045524a6297 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/conversationalsearchservicesettings/converseconversation/SyncConverseConversation.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchServiceSettings_ConverseConversation_sync] +import com.google.cloud.discoveryengine.v1alpha.ConversationalSearchServiceSettings; +import java.time.Duration; + +public class SyncConverseConversation { + + public static void main(String[] args) throws Exception { + syncConverseConversation(); + } + + public static void syncConverseConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ConversationalSearchServiceSettings.Builder conversationalSearchServiceSettingsBuilder = + ConversationalSearchServiceSettings.newBuilder(); + conversationalSearchServiceSettingsBuilder + .converseConversationSettings() + .setRetrySettings( + conversationalSearchServiceSettingsBuilder + .converseConversationSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ConversationalSearchServiceSettings conversationalSearchServiceSettings = + conversationalSearchServiceSettingsBuilder.build(); + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchServiceSettings_ConverseConversation_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/create/SyncCreateSetCredentialsProvider.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..8a44fcbfaa6a --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceSettings; +import com.google.cloud.discoveryengine.v1alpha.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + DocumentServiceSettings documentServiceSettings = + DocumentServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + DocumentServiceClient documentServiceClient = + DocumentServiceClient.create(documentServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_Create_SetCredentialsProvider_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/create/SyncCreateSetCredentialsProvider1.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..d12de59f3db5 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_Create_SetCredentialsProvider1_sync] +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + DocumentServiceSettings documentServiceSettings = + DocumentServiceSettings.newHttpJsonBuilder().build(); + DocumentServiceClient documentServiceClient = + DocumentServiceClient.create(documentServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_Create_SetCredentialsProvider1_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/create/SyncCreateSetEndpoint.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..345ab0da0baf --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_Create_SetEndpoint_sync] +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceSettings; +import com.google.cloud.discoveryengine.v1alpha.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + DocumentServiceSettings documentServiceSettings = + DocumentServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + DocumentServiceClient documentServiceClient = + DocumentServiceClient.create(documentServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_Create_SetEndpoint_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/createdocument/AsyncCreateDocument.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/createdocument/AsyncCreateDocument.java new file mode 100644 index 000000000000..439a8eb77ff8 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/createdocument/AsyncCreateDocument.java @@ -0,0 +1,55 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_CreateDocument_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.BranchName; +import com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest; +import com.google.cloud.discoveryengine.v1alpha.Document; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; + +public class AsyncCreateDocument { + + public static void main(String[] args) throws Exception { + asyncCreateDocument(); + } + + public static void asyncCreateDocument() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + CreateDocumentRequest request = + CreateDocumentRequest.newBuilder() + .setParent( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setDocument(Document.newBuilder().build()) + .setDocumentId("documentId-814940266") + .build(); + ApiFuture future = + documentServiceClient.createDocumentCallable().futureCall(request); + // Do something. + Document response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_CreateDocument_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/createdocument/SyncCreateDocument.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/createdocument/SyncCreateDocument.java new file mode 100644 index 000000000000..24b4e82ec100 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/createdocument/SyncCreateDocument.java @@ -0,0 +1,51 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_CreateDocument_sync] +import com.google.cloud.discoveryengine.v1alpha.BranchName; +import com.google.cloud.discoveryengine.v1alpha.CreateDocumentRequest; +import com.google.cloud.discoveryengine.v1alpha.Document; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; + +public class SyncCreateDocument { + + public static void main(String[] args) throws Exception { + syncCreateDocument(); + } + + public static void syncCreateDocument() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + CreateDocumentRequest request = + CreateDocumentRequest.newBuilder() + .setParent( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setDocument(Document.newBuilder().build()) + .setDocumentId("documentId-814940266") + .build(); + Document response = documentServiceClient.createDocument(request); + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_CreateDocument_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/createdocument/SyncCreateDocumentBranchnameDocumentString.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/createdocument/SyncCreateDocumentBranchnameDocumentString.java new file mode 100644 index 000000000000..419d7e3b07ff --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/createdocument/SyncCreateDocumentBranchnameDocumentString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_CreateDocument_BranchnameDocumentString_sync] +import com.google.cloud.discoveryengine.v1alpha.BranchName; +import com.google.cloud.discoveryengine.v1alpha.Document; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; + +public class SyncCreateDocumentBranchnameDocumentString { + + public static void main(String[] args) throws Exception { + syncCreateDocumentBranchnameDocumentString(); + } + + public static void syncCreateDocumentBranchnameDocumentString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + BranchName parent = + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]"); + Document document = Document.newBuilder().build(); + String documentId = "documentId-814940266"; + Document response = documentServiceClient.createDocument(parent, document, documentId); + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_CreateDocument_BranchnameDocumentString_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/createdocument/SyncCreateDocumentStringDocumentString.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/createdocument/SyncCreateDocumentStringDocumentString.java new file mode 100644 index 000000000000..b781437695bc --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/createdocument/SyncCreateDocumentStringDocumentString.java @@ -0,0 +1,47 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_CreateDocument_StringDocumentString_sync] +import com.google.cloud.discoveryengine.v1alpha.BranchName; +import com.google.cloud.discoveryengine.v1alpha.Document; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; + +public class SyncCreateDocumentStringDocumentString { + + public static void main(String[] args) throws Exception { + syncCreateDocumentStringDocumentString(); + } + + public static void syncCreateDocumentStringDocumentString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + String parent = + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString(); + Document document = Document.newBuilder().build(); + String documentId = "documentId-814940266"; + Document response = documentServiceClient.createDocument(parent, document, documentId); + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_CreateDocument_StringDocumentString_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/deletedocument/AsyncDeleteDocument.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/deletedocument/AsyncDeleteDocument.java new file mode 100644 index 000000000000..194fcd9821ea --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/deletedocument/AsyncDeleteDocument.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_DeleteDocument_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest; +import com.google.cloud.discoveryengine.v1alpha.DocumentName; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; +import com.google.protobuf.Empty; + +public class AsyncDeleteDocument { + + public static void main(String[] args) throws Exception { + asyncDeleteDocument(); + } + + public static void asyncDeleteDocument() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + DeleteDocumentRequest request = + DeleteDocumentRequest.newBuilder() + .setName( + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]") + .toString()) + .build(); + ApiFuture future = documentServiceClient.deleteDocumentCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_DeleteDocument_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/deletedocument/SyncDeleteDocument.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/deletedocument/SyncDeleteDocument.java new file mode 100644 index 000000000000..07eaf0238a75 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/deletedocument/SyncDeleteDocument.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_DeleteDocument_sync] +import com.google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest; +import com.google.cloud.discoveryengine.v1alpha.DocumentName; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteDocument { + + public static void main(String[] args) throws Exception { + syncDeleteDocument(); + } + + public static void syncDeleteDocument() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + DeleteDocumentRequest request = + DeleteDocumentRequest.newBuilder() + .setName( + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]") + .toString()) + .build(); + documentServiceClient.deleteDocument(request); + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_DeleteDocument_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/deletedocument/SyncDeleteDocumentDocumentname.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/deletedocument/SyncDeleteDocumentDocumentname.java new file mode 100644 index 000000000000..fcb006a6953e --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/deletedocument/SyncDeleteDocumentDocumentname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_DeleteDocument_Documentname_sync] +import com.google.cloud.discoveryengine.v1alpha.DocumentName; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteDocumentDocumentname { + + public static void main(String[] args) throws Exception { + syncDeleteDocumentDocumentname(); + } + + public static void syncDeleteDocumentDocumentname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + DocumentName name = + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]"); + documentServiceClient.deleteDocument(name); + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_DeleteDocument_Documentname_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/deletedocument/SyncDeleteDocumentString.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/deletedocument/SyncDeleteDocumentString.java new file mode 100644 index 000000000000..2321dd6f0465 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/deletedocument/SyncDeleteDocumentString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_DeleteDocument_String_sync] +import com.google.cloud.discoveryengine.v1alpha.DocumentName; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteDocumentString { + + public static void main(String[] args) throws Exception { + syncDeleteDocumentString(); + } + + public static void syncDeleteDocumentString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + String name = + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]") + .toString(); + documentServiceClient.deleteDocument(name); + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_DeleteDocument_String_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/getdocument/AsyncGetDocument.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/getdocument/AsyncGetDocument.java new file mode 100644 index 000000000000..93bfc340d985 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/getdocument/AsyncGetDocument.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_GetDocument_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.Document; +import com.google.cloud.discoveryengine.v1alpha.DocumentName; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; +import com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest; + +public class AsyncGetDocument { + + public static void main(String[] args) throws Exception { + asyncGetDocument(); + } + + public static void asyncGetDocument() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + GetDocumentRequest request = + GetDocumentRequest.newBuilder() + .setName( + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]") + .toString()) + .build(); + ApiFuture future = documentServiceClient.getDocumentCallable().futureCall(request); + // Do something. + Document response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_GetDocument_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/getdocument/SyncGetDocument.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/getdocument/SyncGetDocument.java new file mode 100644 index 000000000000..061cecb502d5 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/getdocument/SyncGetDocument.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_GetDocument_sync] +import com.google.cloud.discoveryengine.v1alpha.Document; +import com.google.cloud.discoveryengine.v1alpha.DocumentName; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; +import com.google.cloud.discoveryengine.v1alpha.GetDocumentRequest; + +public class SyncGetDocument { + + public static void main(String[] args) throws Exception { + syncGetDocument(); + } + + public static void syncGetDocument() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + GetDocumentRequest request = + GetDocumentRequest.newBuilder() + .setName( + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]") + .toString()) + .build(); + Document response = documentServiceClient.getDocument(request); + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_GetDocument_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/getdocument/SyncGetDocumentDocumentname.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/getdocument/SyncGetDocumentDocumentname.java new file mode 100644 index 000000000000..f34d7683c1ee --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/getdocument/SyncGetDocumentDocumentname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_GetDocument_Documentname_sync] +import com.google.cloud.discoveryengine.v1alpha.Document; +import com.google.cloud.discoveryengine.v1alpha.DocumentName; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; + +public class SyncGetDocumentDocumentname { + + public static void main(String[] args) throws Exception { + syncGetDocumentDocumentname(); + } + + public static void syncGetDocumentDocumentname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + DocumentName name = + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]"); + Document response = documentServiceClient.getDocument(name); + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_GetDocument_Documentname_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/getdocument/SyncGetDocumentString.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/getdocument/SyncGetDocumentString.java new file mode 100644 index 000000000000..fb89416e1bd7 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/getdocument/SyncGetDocumentString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_GetDocument_String_sync] +import com.google.cloud.discoveryengine.v1alpha.Document; +import com.google.cloud.discoveryengine.v1alpha.DocumentName; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; + +public class SyncGetDocumentString { + + public static void main(String[] args) throws Exception { + syncGetDocumentString(); + } + + public static void syncGetDocumentString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + String name = + DocumentName.ofProjectLocationDataStoreBranchDocumentName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]", "[DOCUMENT]") + .toString(); + Document response = documentServiceClient.getDocument(name); + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_GetDocument_String_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/importdocuments/AsyncImportDocuments.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/importdocuments/AsyncImportDocuments.java new file mode 100644 index 000000000000..eeaa4d9ab359 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/importdocuments/AsyncImportDocuments.java @@ -0,0 +1,57 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_ImportDocuments_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.BranchName; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; +import com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest; +import com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig; +import com.google.longrunning.Operation; + +public class AsyncImportDocuments { + + public static void main(String[] args) throws Exception { + asyncImportDocuments(); + } + + public static void asyncImportDocuments() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + ImportDocumentsRequest request = + ImportDocumentsRequest.newBuilder() + .setParent( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setErrorConfig(ImportErrorConfig.newBuilder().build()) + .setAutoGenerateIds(true) + .setIdField("idField1629396127") + .build(); + ApiFuture future = + documentServiceClient.importDocumentsCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_ImportDocuments_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/importdocuments/AsyncImportDocumentsLRO.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/importdocuments/AsyncImportDocumentsLRO.java new file mode 100644 index 000000000000..047583e8f2de --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/importdocuments/AsyncImportDocumentsLRO.java @@ -0,0 +1,58 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_ImportDocuments_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.discoveryengine.v1alpha.BranchName; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; +import com.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata; +import com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest; +import com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse; +import com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig; + +public class AsyncImportDocumentsLRO { + + public static void main(String[] args) throws Exception { + asyncImportDocumentsLRO(); + } + + public static void asyncImportDocumentsLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + ImportDocumentsRequest request = + ImportDocumentsRequest.newBuilder() + .setParent( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setErrorConfig(ImportErrorConfig.newBuilder().build()) + .setAutoGenerateIds(true) + .setIdField("idField1629396127") + .build(); + OperationFuture future = + documentServiceClient.importDocumentsOperationCallable().futureCall(request); + // Do something. + ImportDocumentsResponse response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_ImportDocuments_LRO_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/importdocuments/SyncImportDocuments.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/importdocuments/SyncImportDocuments.java new file mode 100644 index 000000000000..94d8ac163205 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/importdocuments/SyncImportDocuments.java @@ -0,0 +1,53 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_ImportDocuments_sync] +import com.google.cloud.discoveryengine.v1alpha.BranchName; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; +import com.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest; +import com.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse; +import com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig; + +public class SyncImportDocuments { + + public static void main(String[] args) throws Exception { + syncImportDocuments(); + } + + public static void syncImportDocuments() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + ImportDocumentsRequest request = + ImportDocumentsRequest.newBuilder() + .setParent( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setErrorConfig(ImportErrorConfig.newBuilder().build()) + .setAutoGenerateIds(true) + .setIdField("idField1629396127") + .build(); + ImportDocumentsResponse response = documentServiceClient.importDocumentsAsync(request).get(); + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_ImportDocuments_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/listdocuments/AsyncListDocuments.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/listdocuments/AsyncListDocuments.java new file mode 100644 index 000000000000..807a25d933eb --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/listdocuments/AsyncListDocuments.java @@ -0,0 +1,57 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_ListDocuments_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.BranchName; +import com.google.cloud.discoveryengine.v1alpha.Document; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; +import com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest; + +public class AsyncListDocuments { + + public static void main(String[] args) throws Exception { + asyncListDocuments(); + } + + public static void asyncListDocuments() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + ListDocumentsRequest request = + ListDocumentsRequest.newBuilder() + .setParent( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + documentServiceClient.listDocumentsPagedCallable().futureCall(request); + // Do something. + for (Document element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_ListDocuments_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/listdocuments/AsyncListDocumentsPaged.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/listdocuments/AsyncListDocumentsPaged.java new file mode 100644 index 000000000000..dd7f3a4b2d6e --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/listdocuments/AsyncListDocumentsPaged.java @@ -0,0 +1,65 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_ListDocuments_Paged_async] +import com.google.cloud.discoveryengine.v1alpha.BranchName; +import com.google.cloud.discoveryengine.v1alpha.Document; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; +import com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest; +import com.google.cloud.discoveryengine.v1alpha.ListDocumentsResponse; +import com.google.common.base.Strings; + +public class AsyncListDocumentsPaged { + + public static void main(String[] args) throws Exception { + asyncListDocumentsPaged(); + } + + public static void asyncListDocumentsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + ListDocumentsRequest request = + ListDocumentsRequest.newBuilder() + .setParent( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListDocumentsResponse response = + documentServiceClient.listDocumentsCallable().call(request); + for (Document element : response.getDocumentsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_ListDocuments_Paged_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/listdocuments/SyncListDocuments.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/listdocuments/SyncListDocuments.java new file mode 100644 index 000000000000..2f8fe8fab93c --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/listdocuments/SyncListDocuments.java @@ -0,0 +1,53 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_ListDocuments_sync] +import com.google.cloud.discoveryengine.v1alpha.BranchName; +import com.google.cloud.discoveryengine.v1alpha.Document; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; +import com.google.cloud.discoveryengine.v1alpha.ListDocumentsRequest; + +public class SyncListDocuments { + + public static void main(String[] args) throws Exception { + syncListDocuments(); + } + + public static void syncListDocuments() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + ListDocumentsRequest request = + ListDocumentsRequest.newBuilder() + .setParent( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Document element : documentServiceClient.listDocuments(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_ListDocuments_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/listdocuments/SyncListDocumentsBranchname.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/listdocuments/SyncListDocumentsBranchname.java new file mode 100644 index 000000000000..8471a43b21b7 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/listdocuments/SyncListDocumentsBranchname.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_ListDocuments_Branchname_sync] +import com.google.cloud.discoveryengine.v1alpha.BranchName; +import com.google.cloud.discoveryengine.v1alpha.Document; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; + +public class SyncListDocumentsBranchname { + + public static void main(String[] args) throws Exception { + syncListDocumentsBranchname(); + } + + public static void syncListDocumentsBranchname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + BranchName parent = + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]"); + for (Document element : documentServiceClient.listDocuments(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_ListDocuments_Branchname_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/listdocuments/SyncListDocumentsString.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/listdocuments/SyncListDocumentsString.java new file mode 100644 index 000000000000..46bb4aaa6ece --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/listdocuments/SyncListDocumentsString.java @@ -0,0 +1,47 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_ListDocuments_String_sync] +import com.google.cloud.discoveryengine.v1alpha.BranchName; +import com.google.cloud.discoveryengine.v1alpha.Document; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; + +public class SyncListDocumentsString { + + public static void main(String[] args) throws Exception { + syncListDocumentsString(); + } + + public static void syncListDocumentsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + String parent = + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString(); + for (Document element : documentServiceClient.listDocuments(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_ListDocuments_String_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/purgedocuments/AsyncPurgeDocuments.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/purgedocuments/AsyncPurgeDocuments.java new file mode 100644 index 000000000000..6eba64ef18eb --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/purgedocuments/AsyncPurgeDocuments.java @@ -0,0 +1,55 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_PurgeDocuments_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.BranchName; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; +import com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest; +import com.google.longrunning.Operation; + +public class AsyncPurgeDocuments { + + public static void main(String[] args) throws Exception { + asyncPurgeDocuments(); + } + + public static void asyncPurgeDocuments() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + PurgeDocumentsRequest request = + PurgeDocumentsRequest.newBuilder() + .setParent( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setFilter("filter-1274492040") + .setForce(true) + .build(); + ApiFuture future = + documentServiceClient.purgeDocumentsCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_PurgeDocuments_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/purgedocuments/AsyncPurgeDocumentsLRO.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/purgedocuments/AsyncPurgeDocumentsLRO.java new file mode 100644 index 000000000000..68b796095192 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/purgedocuments/AsyncPurgeDocumentsLRO.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_PurgeDocuments_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.discoveryengine.v1alpha.BranchName; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; +import com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata; +import com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest; +import com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse; + +public class AsyncPurgeDocumentsLRO { + + public static void main(String[] args) throws Exception { + asyncPurgeDocumentsLRO(); + } + + public static void asyncPurgeDocumentsLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + PurgeDocumentsRequest request = + PurgeDocumentsRequest.newBuilder() + .setParent( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setFilter("filter-1274492040") + .setForce(true) + .build(); + OperationFuture future = + documentServiceClient.purgeDocumentsOperationCallable().futureCall(request); + // Do something. + PurgeDocumentsResponse response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_PurgeDocuments_LRO_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/purgedocuments/SyncPurgeDocuments.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/purgedocuments/SyncPurgeDocuments.java new file mode 100644 index 000000000000..2b51f48da3e7 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/purgedocuments/SyncPurgeDocuments.java @@ -0,0 +1,51 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_PurgeDocuments_sync] +import com.google.cloud.discoveryengine.v1alpha.BranchName; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; +import com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsRequest; +import com.google.cloud.discoveryengine.v1alpha.PurgeDocumentsResponse; + +public class SyncPurgeDocuments { + + public static void main(String[] args) throws Exception { + syncPurgeDocuments(); + } + + public static void syncPurgeDocuments() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + PurgeDocumentsRequest request = + PurgeDocumentsRequest.newBuilder() + .setParent( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setFilter("filter-1274492040") + .setForce(true) + .build(); + PurgeDocumentsResponse response = documentServiceClient.purgeDocumentsAsync(request).get(); + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_PurgeDocuments_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/updatedocument/AsyncUpdateDocument.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/updatedocument/AsyncUpdateDocument.java new file mode 100644 index 000000000000..dd27b1a95d44 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/updatedocument/AsyncUpdateDocument.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_UpdateDocument_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.Document; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; +import com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest; + +public class AsyncUpdateDocument { + + public static void main(String[] args) throws Exception { + asyncUpdateDocument(); + } + + public static void asyncUpdateDocument() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + UpdateDocumentRequest request = + UpdateDocumentRequest.newBuilder() + .setDocument(Document.newBuilder().build()) + .setAllowMissing(true) + .build(); + ApiFuture future = + documentServiceClient.updateDocumentCallable().futureCall(request); + // Do something. + Document response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_UpdateDocument_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/updatedocument/SyncUpdateDocument.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/updatedocument/SyncUpdateDocument.java new file mode 100644 index 000000000000..36cf8c1ef25f --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservice/updatedocument/SyncUpdateDocument.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentService_UpdateDocument_sync] +import com.google.cloud.discoveryengine.v1alpha.Document; +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceClient; +import com.google.cloud.discoveryengine.v1alpha.UpdateDocumentRequest; + +public class SyncUpdateDocument { + + public static void main(String[] args) throws Exception { + syncUpdateDocument(); + } + + public static void syncUpdateDocument() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) { + UpdateDocumentRequest request = + UpdateDocumentRequest.newBuilder() + .setDocument(Document.newBuilder().build()) + .setAllowMissing(true) + .build(); + Document response = documentServiceClient.updateDocument(request); + } + } +} +// [END discoveryengine_v1alpha_generated_DocumentService_UpdateDocument_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservicesettings/getdocument/SyncGetDocument.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservicesettings/getdocument/SyncGetDocument.java new file mode 100644 index 000000000000..cc7401614792 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/documentservicesettings/getdocument/SyncGetDocument.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_DocumentServiceSettings_GetDocument_sync] +import com.google.cloud.discoveryengine.v1alpha.DocumentServiceSettings; +import java.time.Duration; + +public class SyncGetDocument { + + public static void main(String[] args) throws Exception { + syncGetDocument(); + } + + public static void syncGetDocument() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + DocumentServiceSettings.Builder documentServiceSettingsBuilder = + DocumentServiceSettings.newBuilder(); + documentServiceSettingsBuilder + .getDocumentSettings() + .setRetrySettings( + documentServiceSettingsBuilder + .getDocumentSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + DocumentServiceSettings documentServiceSettings = documentServiceSettingsBuilder.build(); + } +} +// [END discoveryengine_v1alpha_generated_DocumentServiceSettings_GetDocument_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservice/create/SyncCreateSetCredentialsProvider.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..935f8b9e8e89 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_RecommendationService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.discoveryengine.v1alpha.RecommendationServiceClient; +import com.google.cloud.discoveryengine.v1alpha.RecommendationServiceSettings; +import com.google.cloud.discoveryengine.v1alpha.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RecommendationServiceSettings recommendationServiceSettings = + RecommendationServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + RecommendationServiceClient recommendationServiceClient = + RecommendationServiceClient.create(recommendationServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_RecommendationService_Create_SetCredentialsProvider_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservice/create/SyncCreateSetCredentialsProvider1.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..73c159063179 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_RecommendationService_Create_SetCredentialsProvider1_sync] +import com.google.cloud.discoveryengine.v1alpha.RecommendationServiceClient; +import com.google.cloud.discoveryengine.v1alpha.RecommendationServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RecommendationServiceSettings recommendationServiceSettings = + RecommendationServiceSettings.newHttpJsonBuilder().build(); + RecommendationServiceClient recommendationServiceClient = + RecommendationServiceClient.create(recommendationServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_RecommendationService_Create_SetCredentialsProvider1_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservice/create/SyncCreateSetEndpoint.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..a294a77db518 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_RecommendationService_Create_SetEndpoint_sync] +import com.google.cloud.discoveryengine.v1alpha.RecommendationServiceClient; +import com.google.cloud.discoveryengine.v1alpha.RecommendationServiceSettings; +import com.google.cloud.discoveryengine.v1alpha.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RecommendationServiceSettings recommendationServiceSettings = + RecommendationServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + RecommendationServiceClient recommendationServiceClient = + RecommendationServiceClient.create(recommendationServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_RecommendationService_Create_SetEndpoint_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservice/recommend/AsyncRecommend.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservice/recommend/AsyncRecommend.java new file mode 100644 index 000000000000..35b565d7c02c --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservice/recommend/AsyncRecommend.java @@ -0,0 +1,63 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_RecommendationService_Recommend_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.RecommendRequest; +import com.google.cloud.discoveryengine.v1alpha.RecommendResponse; +import com.google.cloud.discoveryengine.v1alpha.RecommendationServiceClient; +import com.google.cloud.discoveryengine.v1alpha.ServingConfigName; +import com.google.cloud.discoveryengine.v1alpha.UserEvent; +import com.google.protobuf.Value; +import java.util.HashMap; + +public class AsyncRecommend { + + public static void main(String[] args) throws Exception { + asyncRecommend(); + } + + public static void asyncRecommend() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RecommendationServiceClient recommendationServiceClient = + RecommendationServiceClient.create()) { + RecommendRequest request = + RecommendRequest.newBuilder() + .setServingConfig( + ServingConfigName.ofProjectLocationDataStoreServingConfigName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]") + .toString()) + .setUserEvent(UserEvent.newBuilder().build()) + .setPageSize(883849137) + .setFilter("filter-1274492040") + .setValidateOnly(true) + .putAllParams(new HashMap()) + .putAllUserLabels(new HashMap()) + .build(); + ApiFuture future = + recommendationServiceClient.recommendCallable().futureCall(request); + // Do something. + RecommendResponse response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_RecommendationService_Recommend_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservice/recommend/SyncRecommend.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservice/recommend/SyncRecommend.java new file mode 100644 index 000000000000..ea81d3fc1d47 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservice/recommend/SyncRecommend.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_RecommendationService_Recommend_sync] +import com.google.cloud.discoveryengine.v1alpha.RecommendRequest; +import com.google.cloud.discoveryengine.v1alpha.RecommendResponse; +import com.google.cloud.discoveryengine.v1alpha.RecommendationServiceClient; +import com.google.cloud.discoveryengine.v1alpha.ServingConfigName; +import com.google.cloud.discoveryengine.v1alpha.UserEvent; +import com.google.protobuf.Value; +import java.util.HashMap; + +public class SyncRecommend { + + public static void main(String[] args) throws Exception { + syncRecommend(); + } + + public static void syncRecommend() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RecommendationServiceClient recommendationServiceClient = + RecommendationServiceClient.create()) { + RecommendRequest request = + RecommendRequest.newBuilder() + .setServingConfig( + ServingConfigName.ofProjectLocationDataStoreServingConfigName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]") + .toString()) + .setUserEvent(UserEvent.newBuilder().build()) + .setPageSize(883849137) + .setFilter("filter-1274492040") + .setValidateOnly(true) + .putAllParams(new HashMap()) + .putAllUserLabels(new HashMap()) + .build(); + RecommendResponse response = recommendationServiceClient.recommend(request); + } + } +} +// [END discoveryengine_v1alpha_generated_RecommendationService_Recommend_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservicesettings/recommend/SyncRecommend.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservicesettings/recommend/SyncRecommend.java new file mode 100644 index 000000000000..bedbe15386fb --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/recommendationservicesettings/recommend/SyncRecommend.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_RecommendationServiceSettings_Recommend_sync] +import com.google.cloud.discoveryengine.v1alpha.RecommendationServiceSettings; +import java.time.Duration; + +public class SyncRecommend { + + public static void main(String[] args) throws Exception { + syncRecommend(); + } + + public static void syncRecommend() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RecommendationServiceSettings.Builder recommendationServiceSettingsBuilder = + RecommendationServiceSettings.newBuilder(); + recommendationServiceSettingsBuilder + .recommendSettings() + .setRetrySettings( + recommendationServiceSettingsBuilder + .recommendSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + RecommendationServiceSettings recommendationServiceSettings = + recommendationServiceSettingsBuilder.build(); + } +} +// [END discoveryengine_v1alpha_generated_RecommendationServiceSettings_Recommend_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/create/SyncCreateSetCredentialsProvider.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..bcdc742c5dc0 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceSettings; +import com.google.cloud.discoveryengine.v1alpha.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SchemaServiceSettings schemaServiceSettings = + SchemaServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SchemaServiceClient schemaServiceClient = SchemaServiceClient.create(schemaServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_Create_SetCredentialsProvider_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/create/SyncCreateSetCredentialsProvider1.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..b0152c1b3a8c --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,40 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_Create_SetCredentialsProvider1_sync] +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SchemaServiceSettings schemaServiceSettings = + SchemaServiceSettings.newHttpJsonBuilder().build(); + SchemaServiceClient schemaServiceClient = SchemaServiceClient.create(schemaServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_Create_SetCredentialsProvider1_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/create/SyncCreateSetEndpoint.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..29d97e81e45c --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_Create_SetEndpoint_sync] +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceSettings; +import com.google.cloud.discoveryengine.v1alpha.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SchemaServiceSettings schemaServiceSettings = + SchemaServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SchemaServiceClient schemaServiceClient = SchemaServiceClient.create(schemaServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_Create_SetEndpoint_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/createschema/AsyncCreateSchema.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/createschema/AsyncCreateSchema.java new file mode 100644 index 000000000000..7a96d2286e27 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/createschema/AsyncCreateSchema.java @@ -0,0 +1,55 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_CreateSchema_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest; +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.Schema; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; +import com.google.longrunning.Operation; + +public class AsyncCreateSchema { + + public static void main(String[] args) throws Exception { + asyncCreateSchema(); + } + + public static void asyncCreateSchema() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + CreateSchemaRequest request = + CreateSchemaRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setSchema(Schema.newBuilder().build()) + .setSchemaId("schemaId-697673060") + .build(); + ApiFuture future = schemaServiceClient.createSchemaCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_CreateSchema_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/createschema/AsyncCreateSchemaLRO.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/createschema/AsyncCreateSchemaLRO.java new file mode 100644 index 000000000000..6d9b2ad915b2 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/createschema/AsyncCreateSchemaLRO.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_CreateSchema_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata; +import com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest; +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.Schema; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; + +public class AsyncCreateSchemaLRO { + + public static void main(String[] args) throws Exception { + asyncCreateSchemaLRO(); + } + + public static void asyncCreateSchemaLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + CreateSchemaRequest request = + CreateSchemaRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setSchema(Schema.newBuilder().build()) + .setSchemaId("schemaId-697673060") + .build(); + OperationFuture future = + schemaServiceClient.createSchemaOperationCallable().futureCall(request); + // Do something. + Schema response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_CreateSchema_LRO_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/createschema/SyncCreateSchema.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/createschema/SyncCreateSchema.java new file mode 100644 index 000000000000..603d717b0eeb --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/createschema/SyncCreateSchema.java @@ -0,0 +1,51 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_CreateSchema_sync] +import com.google.cloud.discoveryengine.v1alpha.CreateSchemaRequest; +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.Schema; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; + +public class SyncCreateSchema { + + public static void main(String[] args) throws Exception { + syncCreateSchema(); + } + + public static void syncCreateSchema() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + CreateSchemaRequest request = + CreateSchemaRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setSchema(Schema.newBuilder().build()) + .setSchemaId("schemaId-697673060") + .build(); + Schema response = schemaServiceClient.createSchemaAsync(request).get(); + } + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_CreateSchema_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/createschema/SyncCreateSchemaDatastorenameSchemaString.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/createschema/SyncCreateSchemaDatastorenameSchemaString.java new file mode 100644 index 000000000000..a8c6f3d88539 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/createschema/SyncCreateSchemaDatastorenameSchemaString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_CreateSchema_DatastorenameSchemaString_sync] +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.Schema; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; + +public class SyncCreateSchemaDatastorenameSchemaString { + + public static void main(String[] args) throws Exception { + syncCreateSchemaDatastorenameSchemaString(); + } + + public static void syncCreateSchemaDatastorenameSchemaString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + Schema schema = Schema.newBuilder().build(); + String schemaId = "schemaId-697673060"; + Schema response = schemaServiceClient.createSchemaAsync(parent, schema, schemaId).get(); + } + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_CreateSchema_DatastorenameSchemaString_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/createschema/SyncCreateSchemaStringSchemaString.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/createschema/SyncCreateSchemaStringSchemaString.java new file mode 100644 index 000000000000..588919deceb5 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/createschema/SyncCreateSchemaStringSchemaString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_CreateSchema_StringSchemaString_sync] +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.Schema; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; + +public class SyncCreateSchemaStringSchemaString { + + public static void main(String[] args) throws Exception { + syncCreateSchemaStringSchemaString(); + } + + public static void syncCreateSchemaStringSchemaString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + String parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString(); + Schema schema = Schema.newBuilder().build(); + String schemaId = "schemaId-697673060"; + Schema response = schemaServiceClient.createSchemaAsync(parent, schema, schemaId).get(); + } + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_CreateSchema_StringSchemaString_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/deleteschema/AsyncDeleteSchema.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/deleteschema/AsyncDeleteSchema.java new file mode 100644 index 000000000000..242940c87f9f --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/deleteschema/AsyncDeleteSchema.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_DeleteSchema_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest; +import com.google.cloud.discoveryengine.v1alpha.SchemaName; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; +import com.google.longrunning.Operation; + +public class AsyncDeleteSchema { + + public static void main(String[] args) throws Exception { + asyncDeleteSchema(); + } + + public static void asyncDeleteSchema() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + DeleteSchemaRequest request = + DeleteSchemaRequest.newBuilder() + .setName( + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") + .toString()) + .build(); + ApiFuture future = schemaServiceClient.deleteSchemaCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_DeleteSchema_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/deleteschema/AsyncDeleteSchemaLRO.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/deleteschema/AsyncDeleteSchemaLRO.java new file mode 100644 index 000000000000..a07296d72415 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/deleteschema/AsyncDeleteSchemaLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_DeleteSchema_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata; +import com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest; +import com.google.cloud.discoveryengine.v1alpha.SchemaName; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; +import com.google.protobuf.Empty; + +public class AsyncDeleteSchemaLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteSchemaLRO(); + } + + public static void asyncDeleteSchemaLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + DeleteSchemaRequest request = + DeleteSchemaRequest.newBuilder() + .setName( + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") + .toString()) + .build(); + OperationFuture future = + schemaServiceClient.deleteSchemaOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_DeleteSchema_LRO_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/deleteschema/SyncDeleteSchema.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/deleteschema/SyncDeleteSchema.java new file mode 100644 index 000000000000..dcc27f913c7b --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/deleteschema/SyncDeleteSchema.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_DeleteSchema_sync] +import com.google.cloud.discoveryengine.v1alpha.DeleteSchemaRequest; +import com.google.cloud.discoveryengine.v1alpha.SchemaName; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteSchema { + + public static void main(String[] args) throws Exception { + syncDeleteSchema(); + } + + public static void syncDeleteSchema() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + DeleteSchemaRequest request = + DeleteSchemaRequest.newBuilder() + .setName( + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") + .toString()) + .build(); + schemaServiceClient.deleteSchemaAsync(request).get(); + } + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_DeleteSchema_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/deleteschema/SyncDeleteSchemaSchemaname.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/deleteschema/SyncDeleteSchemaSchemaname.java new file mode 100644 index 000000000000..5ff33a9dd6ac --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/deleteschema/SyncDeleteSchemaSchemaname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_DeleteSchema_Schemaname_sync] +import com.google.cloud.discoveryengine.v1alpha.SchemaName; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteSchemaSchemaname { + + public static void main(String[] args) throws Exception { + syncDeleteSchemaSchemaname(); + } + + public static void syncDeleteSchemaSchemaname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + SchemaName name = + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]"); + schemaServiceClient.deleteSchemaAsync(name).get(); + } + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_DeleteSchema_Schemaname_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/deleteschema/SyncDeleteSchemaString.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/deleteschema/SyncDeleteSchemaString.java new file mode 100644 index 000000000000..f81eee36bf3f --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/deleteschema/SyncDeleteSchemaString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_DeleteSchema_String_sync] +import com.google.cloud.discoveryengine.v1alpha.SchemaName; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteSchemaString { + + public static void main(String[] args) throws Exception { + syncDeleteSchemaString(); + } + + public static void syncDeleteSchemaString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + String name = + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") + .toString(); + schemaServiceClient.deleteSchemaAsync(name).get(); + } + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_DeleteSchema_String_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/getschema/AsyncGetSchema.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/getschema/AsyncGetSchema.java new file mode 100644 index 000000000000..bacbb204686c --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/getschema/AsyncGetSchema.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_GetSchema_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest; +import com.google.cloud.discoveryengine.v1alpha.Schema; +import com.google.cloud.discoveryengine.v1alpha.SchemaName; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; + +public class AsyncGetSchema { + + public static void main(String[] args) throws Exception { + asyncGetSchema(); + } + + public static void asyncGetSchema() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + GetSchemaRequest request = + GetSchemaRequest.newBuilder() + .setName( + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") + .toString()) + .build(); + ApiFuture future = schemaServiceClient.getSchemaCallable().futureCall(request); + // Do something. + Schema response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_GetSchema_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/getschema/SyncGetSchema.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/getschema/SyncGetSchema.java new file mode 100644 index 000000000000..b240bf3d81c0 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/getschema/SyncGetSchema.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_GetSchema_sync] +import com.google.cloud.discoveryengine.v1alpha.GetSchemaRequest; +import com.google.cloud.discoveryengine.v1alpha.Schema; +import com.google.cloud.discoveryengine.v1alpha.SchemaName; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; + +public class SyncGetSchema { + + public static void main(String[] args) throws Exception { + syncGetSchema(); + } + + public static void syncGetSchema() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + GetSchemaRequest request = + GetSchemaRequest.newBuilder() + .setName( + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") + .toString()) + .build(); + Schema response = schemaServiceClient.getSchema(request); + } + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_GetSchema_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/getschema/SyncGetSchemaSchemaname.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/getschema/SyncGetSchemaSchemaname.java new file mode 100644 index 000000000000..ebd415234769 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/getschema/SyncGetSchemaSchemaname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_GetSchema_Schemaname_sync] +import com.google.cloud.discoveryengine.v1alpha.Schema; +import com.google.cloud.discoveryengine.v1alpha.SchemaName; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; + +public class SyncGetSchemaSchemaname { + + public static void main(String[] args) throws Exception { + syncGetSchemaSchemaname(); + } + + public static void syncGetSchemaSchemaname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + SchemaName name = + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]"); + Schema response = schemaServiceClient.getSchema(name); + } + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_GetSchema_Schemaname_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/getschema/SyncGetSchemaString.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/getschema/SyncGetSchemaString.java new file mode 100644 index 000000000000..2bd7bc29acf4 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/getschema/SyncGetSchemaString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_GetSchema_String_sync] +import com.google.cloud.discoveryengine.v1alpha.Schema; +import com.google.cloud.discoveryengine.v1alpha.SchemaName; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; + +public class SyncGetSchemaString { + + public static void main(String[] args) throws Exception { + syncGetSchemaString(); + } + + public static void syncGetSchemaString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + String name = + SchemaName.ofProjectLocationDataStoreSchemaName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") + .toString(); + Schema response = schemaServiceClient.getSchema(name); + } + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_GetSchema_String_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/listschemas/AsyncListSchemas.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/listschemas/AsyncListSchemas.java new file mode 100644 index 000000000000..c1a589deaf0c --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/listschemas/AsyncListSchemas.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_ListSchemas_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest; +import com.google.cloud.discoveryengine.v1alpha.Schema; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; + +public class AsyncListSchemas { + + public static void main(String[] args) throws Exception { + asyncListSchemas(); + } + + public static void asyncListSchemas() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + ListSchemasRequest request = + ListSchemasRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = schemaServiceClient.listSchemasPagedCallable().futureCall(request); + // Do something. + for (Schema element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_ListSchemas_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/listschemas/AsyncListSchemasPaged.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/listschemas/AsyncListSchemasPaged.java new file mode 100644 index 000000000000..76c1217713cc --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/listschemas/AsyncListSchemasPaged.java @@ -0,0 +1,64 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_ListSchemas_Paged_async] +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest; +import com.google.cloud.discoveryengine.v1alpha.ListSchemasResponse; +import com.google.cloud.discoveryengine.v1alpha.Schema; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; +import com.google.common.base.Strings; + +public class AsyncListSchemasPaged { + + public static void main(String[] args) throws Exception { + asyncListSchemasPaged(); + } + + public static void asyncListSchemasPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + ListSchemasRequest request = + ListSchemasRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListSchemasResponse response = schemaServiceClient.listSchemasCallable().call(request); + for (Schema element : response.getSchemasList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_ListSchemas_Paged_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/listschemas/SyncListSchemas.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/listschemas/SyncListSchemas.java new file mode 100644 index 000000000000..47db3fbb789f --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/listschemas/SyncListSchemas.java @@ -0,0 +1,53 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_ListSchemas_sync] +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.ListSchemasRequest; +import com.google.cloud.discoveryengine.v1alpha.Schema; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; + +public class SyncListSchemas { + + public static void main(String[] args) throws Exception { + syncListSchemas(); + } + + public static void syncListSchemas() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + ListSchemasRequest request = + ListSchemasRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Schema element : schemaServiceClient.listSchemas(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_ListSchemas_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/listschemas/SyncListSchemasDatastorename.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/listschemas/SyncListSchemasDatastorename.java new file mode 100644 index 000000000000..845a5a0b1526 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/listschemas/SyncListSchemasDatastorename.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_ListSchemas_Datastorename_sync] +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.Schema; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; + +public class SyncListSchemasDatastorename { + + public static void main(String[] args) throws Exception { + syncListSchemasDatastorename(); + } + + public static void syncListSchemasDatastorename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + DataStoreName parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); + for (Schema element : schemaServiceClient.listSchemas(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_ListSchemas_Datastorename_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/listschemas/SyncListSchemasString.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/listschemas/SyncListSchemasString.java new file mode 100644 index 000000000000..1e9b950ea255 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/listschemas/SyncListSchemasString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_ListSchemas_String_sync] +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.Schema; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; + +public class SyncListSchemasString { + + public static void main(String[] args) throws Exception { + syncListSchemasString(); + } + + public static void syncListSchemasString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + String parent = + DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString(); + for (Schema element : schemaServiceClient.listSchemas(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_ListSchemas_String_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/updateschema/AsyncUpdateSchema.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/updateschema/AsyncUpdateSchema.java new file mode 100644 index 000000000000..184788033dbc --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/updateschema/AsyncUpdateSchema.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_UpdateSchema_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.Schema; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; +import com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest; +import com.google.longrunning.Operation; + +public class AsyncUpdateSchema { + + public static void main(String[] args) throws Exception { + asyncUpdateSchema(); + } + + public static void asyncUpdateSchema() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + UpdateSchemaRequest request = + UpdateSchemaRequest.newBuilder() + .setSchema(Schema.newBuilder().build()) + .setAllowMissing(true) + .build(); + ApiFuture future = schemaServiceClient.updateSchemaCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_UpdateSchema_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/updateschema/AsyncUpdateSchemaLRO.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/updateschema/AsyncUpdateSchemaLRO.java new file mode 100644 index 000000000000..c9d5e44e2f67 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/updateschema/AsyncUpdateSchemaLRO.java @@ -0,0 +1,51 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_UpdateSchema_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.discoveryengine.v1alpha.Schema; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; +import com.google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata; +import com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest; + +public class AsyncUpdateSchemaLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateSchemaLRO(); + } + + public static void asyncUpdateSchemaLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + UpdateSchemaRequest request = + UpdateSchemaRequest.newBuilder() + .setSchema(Schema.newBuilder().build()) + .setAllowMissing(true) + .build(); + OperationFuture future = + schemaServiceClient.updateSchemaOperationCallable().futureCall(request); + // Do something. + Schema response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_UpdateSchema_LRO_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/updateschema/SyncUpdateSchema.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/updateschema/SyncUpdateSchema.java new file mode 100644 index 000000000000..f2ebd0eccffc --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservice/updateschema/SyncUpdateSchema.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaService_UpdateSchema_sync] +import com.google.cloud.discoveryengine.v1alpha.Schema; +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceClient; +import com.google.cloud.discoveryengine.v1alpha.UpdateSchemaRequest; + +public class SyncUpdateSchema { + + public static void main(String[] args) throws Exception { + syncUpdateSchema(); + } + + public static void syncUpdateSchema() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + UpdateSchemaRequest request = + UpdateSchemaRequest.newBuilder() + .setSchema(Schema.newBuilder().build()) + .setAllowMissing(true) + .build(); + Schema response = schemaServiceClient.updateSchemaAsync(request).get(); + } + } +} +// [END discoveryengine_v1alpha_generated_SchemaService_UpdateSchema_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservicesettings/getschema/SyncGetSchema.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservicesettings/getschema/SyncGetSchema.java new file mode 100644 index 000000000000..1864fe9de7bf --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/schemaservicesettings/getschema/SyncGetSchema.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SchemaServiceSettings_GetSchema_sync] +import com.google.cloud.discoveryengine.v1alpha.SchemaServiceSettings; +import java.time.Duration; + +public class SyncGetSchema { + + public static void main(String[] args) throws Exception { + syncGetSchema(); + } + + public static void syncGetSchema() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SchemaServiceSettings.Builder schemaServiceSettingsBuilder = SchemaServiceSettings.newBuilder(); + schemaServiceSettingsBuilder + .getSchemaSettings() + .setRetrySettings( + schemaServiceSettingsBuilder + .getSchemaSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SchemaServiceSettings schemaServiceSettings = schemaServiceSettingsBuilder.build(); + } +} +// [END discoveryengine_v1alpha_generated_SchemaServiceSettings_GetSchema_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/create/SyncCreateSetCredentialsProvider.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..914e96be0169 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SearchService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.discoveryengine.v1alpha.SearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.SearchServiceSettings; +import com.google.cloud.discoveryengine.v1alpha.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SearchServiceSettings searchServiceSettings = + SearchServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SearchServiceClient searchServiceClient = SearchServiceClient.create(searchServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_SearchService_Create_SetCredentialsProvider_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/create/SyncCreateSetCredentialsProvider1.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..5c3e2ef9de66 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,40 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SearchService_Create_SetCredentialsProvider1_sync] +import com.google.cloud.discoveryengine.v1alpha.SearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.SearchServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SearchServiceSettings searchServiceSettings = + SearchServiceSettings.newHttpJsonBuilder().build(); + SearchServiceClient searchServiceClient = SearchServiceClient.create(searchServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_SearchService_Create_SetCredentialsProvider1_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/create/SyncCreateSetEndpoint.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..cc9e5fa53eea --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SearchService_Create_SetEndpoint_sync] +import com.google.cloud.discoveryengine.v1alpha.SearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.SearchServiceSettings; +import com.google.cloud.discoveryengine.v1alpha.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SearchServiceSettings searchServiceSettings = + SearchServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SearchServiceClient searchServiceClient = SearchServiceClient.create(searchServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_SearchService_Create_SetEndpoint_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/search/AsyncSearch.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/search/AsyncSearch.java new file mode 100644 index 000000000000..5156745be826 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/search/AsyncSearch.java @@ -0,0 +1,83 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SearchService_Search_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.BranchName; +import com.google.cloud.discoveryengine.v1alpha.SearchRequest; +import com.google.cloud.discoveryengine.v1alpha.SearchResponse; +import com.google.cloud.discoveryengine.v1alpha.SearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.ServingConfigName; +import com.google.cloud.discoveryengine.v1alpha.UserInfo; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.HashMap; + +public class AsyncSearch { + + public static void main(String[] args) throws Exception { + asyncSearch(); + } + + public static void asyncSearch() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) { + SearchRequest request = + SearchRequest.newBuilder() + .setServingConfig( + ServingConfigName.ofProjectLocationDataStoreServingConfigName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]") + .toString()) + .setBranch( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setQuery("query107944136") + .setImageQuery(SearchRequest.ImageQuery.newBuilder().build()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOffset(-1019779949) + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .setUserInfo(UserInfo.newBuilder().build()) + .addAllFacetSpecs(new ArrayList()) + .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) + .putAllParams(new HashMap()) + .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) + .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) + .setUserPseudoId("userPseudoId-1155274652") + .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build()) + .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build()) + .setRankingExpression("rankingExpression2110320494") + .setSafeSearch(true) + .putAllUserLabels(new HashMap()) + .build(); + ApiFuture future = + searchServiceClient.searchPagedCallable().futureCall(request); + // Do something. + for (SearchResponse.SearchResult element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END discoveryengine_v1alpha_generated_SearchService_Search_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/search/AsyncSearchPaged.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/search/AsyncSearchPaged.java new file mode 100644 index 000000000000..5dab6d1236e6 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/search/AsyncSearchPaged.java @@ -0,0 +1,89 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SearchService_Search_Paged_async] +import com.google.cloud.discoveryengine.v1alpha.BranchName; +import com.google.cloud.discoveryengine.v1alpha.SearchRequest; +import com.google.cloud.discoveryengine.v1alpha.SearchResponse; +import com.google.cloud.discoveryengine.v1alpha.SearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.ServingConfigName; +import com.google.cloud.discoveryengine.v1alpha.UserInfo; +import com.google.common.base.Strings; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.HashMap; + +public class AsyncSearchPaged { + + public static void main(String[] args) throws Exception { + asyncSearchPaged(); + } + + public static void asyncSearchPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) { + SearchRequest request = + SearchRequest.newBuilder() + .setServingConfig( + ServingConfigName.ofProjectLocationDataStoreServingConfigName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]") + .toString()) + .setBranch( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setQuery("query107944136") + .setImageQuery(SearchRequest.ImageQuery.newBuilder().build()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOffset(-1019779949) + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .setUserInfo(UserInfo.newBuilder().build()) + .addAllFacetSpecs(new ArrayList()) + .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) + .putAllParams(new HashMap()) + .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) + .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) + .setUserPseudoId("userPseudoId-1155274652") + .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build()) + .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build()) + .setRankingExpression("rankingExpression2110320494") + .setSafeSearch(true) + .putAllUserLabels(new HashMap()) + .build(); + while (true) { + SearchResponse response = searchServiceClient.searchCallable().call(request); + for (SearchResponse.SearchResult element : response.getResultsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END discoveryengine_v1alpha_generated_SearchService_Search_Paged_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/search/SyncSearch.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/search/SyncSearch.java new file mode 100644 index 000000000000..e23bc7a6f1b9 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservice/search/SyncSearch.java @@ -0,0 +1,79 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SearchService_Search_sync] +import com.google.cloud.discoveryengine.v1alpha.BranchName; +import com.google.cloud.discoveryengine.v1alpha.SearchRequest; +import com.google.cloud.discoveryengine.v1alpha.SearchResponse; +import com.google.cloud.discoveryengine.v1alpha.SearchServiceClient; +import com.google.cloud.discoveryengine.v1alpha.ServingConfigName; +import com.google.cloud.discoveryengine.v1alpha.UserInfo; +import com.google.protobuf.Value; +import java.util.ArrayList; +import java.util.HashMap; + +public class SyncSearch { + + public static void main(String[] args) throws Exception { + syncSearch(); + } + + public static void syncSearch() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) { + SearchRequest request = + SearchRequest.newBuilder() + .setServingConfig( + ServingConfigName.ofProjectLocationDataStoreServingConfigName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SERVING_CONFIG]") + .toString()) + .setBranch( + BranchName.ofProjectLocationDataStoreBranchName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]") + .toString()) + .setQuery("query107944136") + .setImageQuery(SearchRequest.ImageQuery.newBuilder().build()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOffset(-1019779949) + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .setUserInfo(UserInfo.newBuilder().build()) + .addAllFacetSpecs(new ArrayList()) + .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build()) + .putAllParams(new HashMap()) + .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build()) + .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build()) + .setUserPseudoId("userPseudoId-1155274652") + .setContentSearchSpec(SearchRequest.ContentSearchSpec.newBuilder().build()) + .setEmbeddingSpec(SearchRequest.EmbeddingSpec.newBuilder().build()) + .setRankingExpression("rankingExpression2110320494") + .setSafeSearch(true) + .putAllUserLabels(new HashMap()) + .build(); + for (SearchResponse.SearchResult element : searchServiceClient.search(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END discoveryengine_v1alpha_generated_SearchService_Search_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservicesettings/search/SyncSearch.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservicesettings/search/SyncSearch.java new file mode 100644 index 000000000000..a66b7500ae93 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/searchservicesettings/search/SyncSearch.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SearchServiceSettings_Search_sync] +import com.google.cloud.discoveryengine.v1alpha.SearchServiceSettings; +import java.time.Duration; + +public class SyncSearch { + + public static void main(String[] args) throws Exception { + syncSearch(); + } + + public static void syncSearch() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SearchServiceSettings.Builder searchServiceSettingsBuilder = SearchServiceSettings.newBuilder(); + searchServiceSettingsBuilder + .searchSettings() + .setRetrySettings( + searchServiceSettingsBuilder + .searchSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SearchServiceSettings searchServiceSettings = searchServiceSettingsBuilder.build(); + } +} +// [END discoveryengine_v1alpha_generated_SearchServiceSettings_Search_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/create/SyncCreateSetCredentialsProvider.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..2ed6bea9a17b --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SiteSearchEngineService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceClient; +import com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceSettings; +import com.google.cloud.discoveryengine.v1alpha.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SiteSearchEngineServiceSettings siteSearchEngineServiceSettings = + SiteSearchEngineServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SiteSearchEngineServiceClient siteSearchEngineServiceClient = + SiteSearchEngineServiceClient.create(siteSearchEngineServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_SiteSearchEngineService_Create_SetCredentialsProvider_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/create/SyncCreateSetCredentialsProvider1.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..d2a41ef3b6ae --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SiteSearchEngineService_Create_SetCredentialsProvider1_sync] +import com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceClient; +import com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SiteSearchEngineServiceSettings siteSearchEngineServiceSettings = + SiteSearchEngineServiceSettings.newHttpJsonBuilder().build(); + SiteSearchEngineServiceClient siteSearchEngineServiceClient = + SiteSearchEngineServiceClient.create(siteSearchEngineServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_SiteSearchEngineService_Create_SetCredentialsProvider1_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/create/SyncCreateSetEndpoint.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..1df29eaf95e0 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SiteSearchEngineService_Create_SetEndpoint_sync] +import com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceClient; +import com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceSettings; +import com.google.cloud.discoveryengine.v1alpha.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SiteSearchEngineServiceSettings siteSearchEngineServiceSettings = + SiteSearchEngineServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SiteSearchEngineServiceClient siteSearchEngineServiceClient = + SiteSearchEngineServiceClient.create(siteSearchEngineServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_SiteSearchEngineService_Create_SetEndpoint_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/recrawluris/AsyncRecrawlUris.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/recrawluris/AsyncRecrawlUris.java new file mode 100644 index 000000000000..9cb0e34566f0 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/recrawluris/AsyncRecrawlUris.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SiteSearchEngineService_RecrawlUris_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest; +import com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineName; +import com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceClient; +import com.google.longrunning.Operation; +import java.util.ArrayList; + +public class AsyncRecrawlUris { + + public static void main(String[] args) throws Exception { + asyncRecrawlUris(); + } + + public static void asyncRecrawlUris() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SiteSearchEngineServiceClient siteSearchEngineServiceClient = + SiteSearchEngineServiceClient.create()) { + RecrawlUrisRequest request = + RecrawlUrisRequest.newBuilder() + .setSiteSearchEngine( + SiteSearchEngineName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .addAllUris(new ArrayList()) + .build(); + ApiFuture future = + siteSearchEngineServiceClient.recrawlUrisCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_SiteSearchEngineService_RecrawlUris_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/recrawluris/AsyncRecrawlUrisLRO.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/recrawluris/AsyncRecrawlUrisLRO.java new file mode 100644 index 000000000000..bac950d79bbf --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/recrawluris/AsyncRecrawlUrisLRO.java @@ -0,0 +1,57 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SiteSearchEngineService_RecrawlUris_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata; +import com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest; +import com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse; +import com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineName; +import com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceClient; +import java.util.ArrayList; + +public class AsyncRecrawlUrisLRO { + + public static void main(String[] args) throws Exception { + asyncRecrawlUrisLRO(); + } + + public static void asyncRecrawlUrisLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SiteSearchEngineServiceClient siteSearchEngineServiceClient = + SiteSearchEngineServiceClient.create()) { + RecrawlUrisRequest request = + RecrawlUrisRequest.newBuilder() + .setSiteSearchEngine( + SiteSearchEngineName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .addAllUris(new ArrayList()) + .build(); + OperationFuture future = + siteSearchEngineServiceClient.recrawlUrisOperationCallable().futureCall(request); + // Do something. + RecrawlUrisResponse response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_SiteSearchEngineService_RecrawlUris_LRO_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/recrawluris/SyncRecrawlUris.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/recrawluris/SyncRecrawlUris.java new file mode 100644 index 000000000000..8eb02c376fa1 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservice/recrawluris/SyncRecrawlUris.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SiteSearchEngineService_RecrawlUris_sync] +import com.google.cloud.discoveryengine.v1alpha.RecrawlUrisRequest; +import com.google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse; +import com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineName; +import com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceClient; +import java.util.ArrayList; + +public class SyncRecrawlUris { + + public static void main(String[] args) throws Exception { + syncRecrawlUris(); + } + + public static void syncRecrawlUris() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SiteSearchEngineServiceClient siteSearchEngineServiceClient = + SiteSearchEngineServiceClient.create()) { + RecrawlUrisRequest request = + RecrawlUrisRequest.newBuilder() + .setSiteSearchEngine( + SiteSearchEngineName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .addAllUris(new ArrayList()) + .build(); + RecrawlUrisResponse response = siteSearchEngineServiceClient.recrawlUrisAsync(request).get(); + } + } +} +// [END discoveryengine_v1alpha_generated_SiteSearchEngineService_RecrawlUris_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservicesettings/recrawluris/SyncRecrawlUris.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservicesettings/recrawluris/SyncRecrawlUris.java new file mode 100644 index 000000000000..63102988a039 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/sitesearchengineservicesettings/recrawluris/SyncRecrawlUris.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_SiteSearchEngineServiceSettings_RecrawlUris_sync] +import com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceSettings; +import java.time.Duration; + +public class SyncRecrawlUris { + + public static void main(String[] args) throws Exception { + syncRecrawlUris(); + } + + public static void syncRecrawlUris() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SiteSearchEngineServiceSettings.Builder siteSearchEngineServiceSettingsBuilder = + SiteSearchEngineServiceSettings.newBuilder(); + siteSearchEngineServiceSettingsBuilder + .recrawlUrisSettings() + .setRetrySettings( + siteSearchEngineServiceSettingsBuilder + .recrawlUrisSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SiteSearchEngineServiceSettings siteSearchEngineServiceSettings = + siteSearchEngineServiceSettingsBuilder.build(); + } +} +// [END discoveryengine_v1alpha_generated_SiteSearchEngineServiceSettings_RecrawlUris_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/completionservicestubsettings/completequery/SyncCompleteQuery.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/completionservicestubsettings/completequery/SyncCompleteQuery.java new file mode 100644 index 000000000000..d19923a4351d --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/completionservicestubsettings/completequery/SyncCompleteQuery.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub.samples; + +// [START discoveryengine_v1alpha_generated_CompletionServiceStubSettings_CompleteQuery_sync] +import com.google.cloud.discoveryengine.v1alpha.stub.CompletionServiceStubSettings; +import java.time.Duration; + +public class SyncCompleteQuery { + + public static void main(String[] args) throws Exception { + syncCompleteQuery(); + } + + public static void syncCompleteQuery() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + CompletionServiceStubSettings.Builder completionServiceSettingsBuilder = + CompletionServiceStubSettings.newBuilder(); + completionServiceSettingsBuilder + .completeQuerySettings() + .setRetrySettings( + completionServiceSettingsBuilder + .completeQuerySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CompletionServiceStubSettings completionServiceSettings = + completionServiceSettingsBuilder.build(); + } +} +// [END discoveryengine_v1alpha_generated_CompletionServiceStubSettings_CompleteQuery_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/conversationalsearchservicestubsettings/converseconversation/SyncConverseConversation.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/conversationalsearchservicestubsettings/converseconversation/SyncConverseConversation.java new file mode 100644 index 000000000000..94a5577b065d --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/conversationalsearchservicestubsettings/converseconversation/SyncConverseConversation.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub.samples; + +// [START discoveryengine_v1alpha_generated_ConversationalSearchServiceStubSettings_ConverseConversation_sync] +import com.google.cloud.discoveryengine.v1alpha.stub.ConversationalSearchServiceStubSettings; +import java.time.Duration; + +public class SyncConverseConversation { + + public static void main(String[] args) throws Exception { + syncConverseConversation(); + } + + public static void syncConverseConversation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ConversationalSearchServiceStubSettings.Builder conversationalSearchServiceSettingsBuilder = + ConversationalSearchServiceStubSettings.newBuilder(); + conversationalSearchServiceSettingsBuilder + .converseConversationSettings() + .setRetrySettings( + conversationalSearchServiceSettingsBuilder + .converseConversationSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ConversationalSearchServiceStubSettings conversationalSearchServiceSettings = + conversationalSearchServiceSettingsBuilder.build(); + } +} +// [END discoveryengine_v1alpha_generated_ConversationalSearchServiceStubSettings_ConverseConversation_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/documentservicestubsettings/getdocument/SyncGetDocument.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/documentservicestubsettings/getdocument/SyncGetDocument.java new file mode 100644 index 000000000000..105ca62e705b --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/documentservicestubsettings/getdocument/SyncGetDocument.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub.samples; + +// [START discoveryengine_v1alpha_generated_DocumentServiceStubSettings_GetDocument_sync] +import com.google.cloud.discoveryengine.v1alpha.stub.DocumentServiceStubSettings; +import java.time.Duration; + +public class SyncGetDocument { + + public static void main(String[] args) throws Exception { + syncGetDocument(); + } + + public static void syncGetDocument() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + DocumentServiceStubSettings.Builder documentServiceSettingsBuilder = + DocumentServiceStubSettings.newBuilder(); + documentServiceSettingsBuilder + .getDocumentSettings() + .setRetrySettings( + documentServiceSettingsBuilder + .getDocumentSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + DocumentServiceStubSettings documentServiceSettings = documentServiceSettingsBuilder.build(); + } +} +// [END discoveryengine_v1alpha_generated_DocumentServiceStubSettings_GetDocument_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/recommendationservicestubsettings/recommend/SyncRecommend.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/recommendationservicestubsettings/recommend/SyncRecommend.java new file mode 100644 index 000000000000..ab94e4ededa3 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/recommendationservicestubsettings/recommend/SyncRecommend.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub.samples; + +// [START discoveryengine_v1alpha_generated_RecommendationServiceStubSettings_Recommend_sync] +import com.google.cloud.discoveryengine.v1alpha.stub.RecommendationServiceStubSettings; +import java.time.Duration; + +public class SyncRecommend { + + public static void main(String[] args) throws Exception { + syncRecommend(); + } + + public static void syncRecommend() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RecommendationServiceStubSettings.Builder recommendationServiceSettingsBuilder = + RecommendationServiceStubSettings.newBuilder(); + recommendationServiceSettingsBuilder + .recommendSettings() + .setRetrySettings( + recommendationServiceSettingsBuilder + .recommendSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + RecommendationServiceStubSettings recommendationServiceSettings = + recommendationServiceSettingsBuilder.build(); + } +} +// [END discoveryengine_v1alpha_generated_RecommendationServiceStubSettings_Recommend_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/schemaservicestubsettings/getschema/SyncGetSchema.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/schemaservicestubsettings/getschema/SyncGetSchema.java new file mode 100644 index 000000000000..a40e4c1396a0 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/schemaservicestubsettings/getschema/SyncGetSchema.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub.samples; + +// [START discoveryengine_v1alpha_generated_SchemaServiceStubSettings_GetSchema_sync] +import com.google.cloud.discoveryengine.v1alpha.stub.SchemaServiceStubSettings; +import java.time.Duration; + +public class SyncGetSchema { + + public static void main(String[] args) throws Exception { + syncGetSchema(); + } + + public static void syncGetSchema() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SchemaServiceStubSettings.Builder schemaServiceSettingsBuilder = + SchemaServiceStubSettings.newBuilder(); + schemaServiceSettingsBuilder + .getSchemaSettings() + .setRetrySettings( + schemaServiceSettingsBuilder + .getSchemaSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SchemaServiceStubSettings schemaServiceSettings = schemaServiceSettingsBuilder.build(); + } +} +// [END discoveryengine_v1alpha_generated_SchemaServiceStubSettings_GetSchema_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/searchservicestubsettings/search/SyncSearch.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/searchservicestubsettings/search/SyncSearch.java new file mode 100644 index 000000000000..705f3f69dcc9 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/searchservicestubsettings/search/SyncSearch.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub.samples; + +// [START discoveryengine_v1alpha_generated_SearchServiceStubSettings_Search_sync] +import com.google.cloud.discoveryengine.v1alpha.stub.SearchServiceStubSettings; +import java.time.Duration; + +public class SyncSearch { + + public static void main(String[] args) throws Exception { + syncSearch(); + } + + public static void syncSearch() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SearchServiceStubSettings.Builder searchServiceSettingsBuilder = + SearchServiceStubSettings.newBuilder(); + searchServiceSettingsBuilder + .searchSettings() + .setRetrySettings( + searchServiceSettingsBuilder + .searchSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SearchServiceStubSettings searchServiceSettings = searchServiceSettingsBuilder.build(); + } +} +// [END discoveryengine_v1alpha_generated_SearchServiceStubSettings_Search_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/sitesearchengineservicestubsettings/recrawluris/SyncRecrawlUris.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/sitesearchengineservicestubsettings/recrawluris/SyncRecrawlUris.java new file mode 100644 index 000000000000..58a92e336437 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/sitesearchengineservicestubsettings/recrawluris/SyncRecrawlUris.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub.samples; + +// [START discoveryengine_v1alpha_generated_SiteSearchEngineServiceStubSettings_RecrawlUris_sync] +import com.google.cloud.discoveryengine.v1alpha.stub.SiteSearchEngineServiceStubSettings; +import java.time.Duration; + +public class SyncRecrawlUris { + + public static void main(String[] args) throws Exception { + syncRecrawlUris(); + } + + public static void syncRecrawlUris() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SiteSearchEngineServiceStubSettings.Builder siteSearchEngineServiceSettingsBuilder = + SiteSearchEngineServiceStubSettings.newBuilder(); + siteSearchEngineServiceSettingsBuilder + .recrawlUrisSettings() + .setRetrySettings( + siteSearchEngineServiceSettingsBuilder + .recrawlUrisSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SiteSearchEngineServiceStubSettings siteSearchEngineServiceSettings = + siteSearchEngineServiceSettingsBuilder.build(); + } +} +// [END discoveryengine_v1alpha_generated_SiteSearchEngineServiceStubSettings_RecrawlUris_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/usereventservicestubsettings/writeuserevent/SyncWriteUserEvent.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/usereventservicestubsettings/writeuserevent/SyncWriteUserEvent.java new file mode 100644 index 000000000000..81b2ff95b5b3 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/stub/usereventservicestubsettings/writeuserevent/SyncWriteUserEvent.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.stub.samples; + +// [START discoveryengine_v1alpha_generated_UserEventServiceStubSettings_WriteUserEvent_sync] +import com.google.cloud.discoveryengine.v1alpha.stub.UserEventServiceStubSettings; +import java.time.Duration; + +public class SyncWriteUserEvent { + + public static void main(String[] args) throws Exception { + syncWriteUserEvent(); + } + + public static void syncWriteUserEvent() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + UserEventServiceStubSettings.Builder userEventServiceSettingsBuilder = + UserEventServiceStubSettings.newBuilder(); + userEventServiceSettingsBuilder + .writeUserEventSettings() + .setRetrySettings( + userEventServiceSettingsBuilder + .writeUserEventSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + UserEventServiceStubSettings userEventServiceSettings = userEventServiceSettingsBuilder.build(); + } +} +// [END discoveryengine_v1alpha_generated_UserEventServiceStubSettings_WriteUserEvent_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/collectuserevent/AsyncCollectUserEvent.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/collectuserevent/AsyncCollectUserEvent.java new file mode 100644 index 000000000000..4e4c1f7269b6 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/collectuserevent/AsyncCollectUserEvent.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_UserEventService_CollectUserEvent_async] +import com.google.api.HttpBody; +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest; +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.UserEventServiceClient; + +public class AsyncCollectUserEvent { + + public static void main(String[] args) throws Exception { + asyncCollectUserEvent(); + } + + public static void asyncCollectUserEvent() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + CollectUserEventRequest request = + CollectUserEventRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setUserEvent("userEvent315571599") + .setUri("uri116076") + .setEts(100772) + .build(); + ApiFuture future = + userEventServiceClient.collectUserEventCallable().futureCall(request); + // Do something. + HttpBody response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_UserEventService_CollectUserEvent_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/collectuserevent/SyncCollectUserEvent.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/collectuserevent/SyncCollectUserEvent.java new file mode 100644 index 000000000000..f9b11a7abc4e --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/collectuserevent/SyncCollectUserEvent.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_UserEventService_CollectUserEvent_sync] +import com.google.api.HttpBody; +import com.google.cloud.discoveryengine.v1alpha.CollectUserEventRequest; +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.UserEventServiceClient; + +public class SyncCollectUserEvent { + + public static void main(String[] args) throws Exception { + syncCollectUserEvent(); + } + + public static void syncCollectUserEvent() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + CollectUserEventRequest request = + CollectUserEventRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setUserEvent("userEvent315571599") + .setUri("uri116076") + .setEts(100772) + .build(); + HttpBody response = userEventServiceClient.collectUserEvent(request); + } + } +} +// [END discoveryengine_v1alpha_generated_UserEventService_CollectUserEvent_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/create/SyncCreateSetCredentialsProvider.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..41b0a03b5085 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_UserEventService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.discoveryengine.v1alpha.UserEventServiceClient; +import com.google.cloud.discoveryengine.v1alpha.UserEventServiceSettings; +import com.google.cloud.discoveryengine.v1alpha.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + UserEventServiceSettings userEventServiceSettings = + UserEventServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + UserEventServiceClient userEventServiceClient = + UserEventServiceClient.create(userEventServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_UserEventService_Create_SetCredentialsProvider_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/create/SyncCreateSetCredentialsProvider1.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..1388644c00a2 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_UserEventService_Create_SetCredentialsProvider1_sync] +import com.google.cloud.discoveryengine.v1alpha.UserEventServiceClient; +import com.google.cloud.discoveryengine.v1alpha.UserEventServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + UserEventServiceSettings userEventServiceSettings = + UserEventServiceSettings.newHttpJsonBuilder().build(); + UserEventServiceClient userEventServiceClient = + UserEventServiceClient.create(userEventServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_UserEventService_Create_SetCredentialsProvider1_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/create/SyncCreateSetEndpoint.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..461bc05b8e6e --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_UserEventService_Create_SetEndpoint_sync] +import com.google.cloud.discoveryengine.v1alpha.UserEventServiceClient; +import com.google.cloud.discoveryengine.v1alpha.UserEventServiceSettings; +import com.google.cloud.discoveryengine.v1alpha.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + UserEventServiceSettings userEventServiceSettings = + UserEventServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + UserEventServiceClient userEventServiceClient = + UserEventServiceClient.create(userEventServiceSettings); + } +} +// [END discoveryengine_v1alpha_generated_UserEventService_Create_SetEndpoint_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/importuserevents/AsyncImportUserEvents.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/importuserevents/AsyncImportUserEvents.java new file mode 100644 index 000000000000..57822f42121f --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/importuserevents/AsyncImportUserEvents.java @@ -0,0 +1,55 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_UserEventService_ImportUserEvents_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig; +import com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest; +import com.google.cloud.discoveryengine.v1alpha.UserEventServiceClient; +import com.google.longrunning.Operation; + +public class AsyncImportUserEvents { + + public static void main(String[] args) throws Exception { + asyncImportUserEvents(); + } + + public static void asyncImportUserEvents() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + ImportUserEventsRequest request = + ImportUserEventsRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setErrorConfig(ImportErrorConfig.newBuilder().build()) + .build(); + ApiFuture future = + userEventServiceClient.importUserEventsCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_UserEventService_ImportUserEvents_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/importuserevents/AsyncImportUserEventsLRO.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/importuserevents/AsyncImportUserEventsLRO.java new file mode 100644 index 000000000000..f83503b75790 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/importuserevents/AsyncImportUserEventsLRO.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_UserEventService_ImportUserEvents_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig; +import com.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata; +import com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest; +import com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse; +import com.google.cloud.discoveryengine.v1alpha.UserEventServiceClient; + +public class AsyncImportUserEventsLRO { + + public static void main(String[] args) throws Exception { + asyncImportUserEventsLRO(); + } + + public static void asyncImportUserEventsLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + ImportUserEventsRequest request = + ImportUserEventsRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setErrorConfig(ImportErrorConfig.newBuilder().build()) + .build(); + OperationFuture future = + userEventServiceClient.importUserEventsOperationCallable().futureCall(request); + // Do something. + ImportUserEventsResponse response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_UserEventService_ImportUserEvents_LRO_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/importuserevents/SyncImportUserEvents.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/importuserevents/SyncImportUserEvents.java new file mode 100644 index 000000000000..aa08e1423f4b --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/importuserevents/SyncImportUserEvents.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_UserEventService_ImportUserEvents_sync] +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.ImportErrorConfig; +import com.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest; +import com.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse; +import com.google.cloud.discoveryengine.v1alpha.UserEventServiceClient; + +public class SyncImportUserEvents { + + public static void main(String[] args) throws Exception { + syncImportUserEvents(); + } + + public static void syncImportUserEvents() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + ImportUserEventsRequest request = + ImportUserEventsRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setErrorConfig(ImportErrorConfig.newBuilder().build()) + .build(); + ImportUserEventsResponse response = + userEventServiceClient.importUserEventsAsync(request).get(); + } + } +} +// [END discoveryengine_v1alpha_generated_UserEventService_ImportUserEvents_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/purgeuserevents/AsyncPurgeUserEvents.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/purgeuserevents/AsyncPurgeUserEvents.java new file mode 100644 index 000000000000..12ac07358185 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/purgeuserevents/AsyncPurgeUserEvents.java @@ -0,0 +1,55 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_UserEventService_PurgeUserEvents_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest; +import com.google.cloud.discoveryengine.v1alpha.UserEventServiceClient; +import com.google.longrunning.Operation; + +public class AsyncPurgeUserEvents { + + public static void main(String[] args) throws Exception { + asyncPurgeUserEvents(); + } + + public static void asyncPurgeUserEvents() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + PurgeUserEventsRequest request = + PurgeUserEventsRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setFilter("filter-1274492040") + .setForce(true) + .build(); + ApiFuture future = + userEventServiceClient.purgeUserEventsCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_UserEventService_PurgeUserEvents_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/purgeuserevents/AsyncPurgeUserEventsLRO.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/purgeuserevents/AsyncPurgeUserEventsLRO.java new file mode 100644 index 000000000000..cce940c93a0e --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/purgeuserevents/AsyncPurgeUserEventsLRO.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_UserEventService_PurgeUserEvents_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsMetadata; +import com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest; +import com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse; +import com.google.cloud.discoveryengine.v1alpha.UserEventServiceClient; + +public class AsyncPurgeUserEventsLRO { + + public static void main(String[] args) throws Exception { + asyncPurgeUserEventsLRO(); + } + + public static void asyncPurgeUserEventsLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + PurgeUserEventsRequest request = + PurgeUserEventsRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setFilter("filter-1274492040") + .setForce(true) + .build(); + OperationFuture future = + userEventServiceClient.purgeUserEventsOperationCallable().futureCall(request); + // Do something. + PurgeUserEventsResponse response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_UserEventService_PurgeUserEvents_LRO_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/purgeuserevents/SyncPurgeUserEvents.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/purgeuserevents/SyncPurgeUserEvents.java new file mode 100644 index 000000000000..2612cc84d480 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/purgeuserevents/SyncPurgeUserEvents.java @@ -0,0 +1,51 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_UserEventService_PurgeUserEvents_sync] +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsRequest; +import com.google.cloud.discoveryengine.v1alpha.PurgeUserEventsResponse; +import com.google.cloud.discoveryengine.v1alpha.UserEventServiceClient; + +public class SyncPurgeUserEvents { + + public static void main(String[] args) throws Exception { + syncPurgeUserEvents(); + } + + public static void syncPurgeUserEvents() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + PurgeUserEventsRequest request = + PurgeUserEventsRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setFilter("filter-1274492040") + .setForce(true) + .build(); + PurgeUserEventsResponse response = userEventServiceClient.purgeUserEventsAsync(request).get(); + } + } +} +// [END discoveryengine_v1alpha_generated_UserEventService_PurgeUserEvents_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/writeuserevent/AsyncWriteUserEvent.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/writeuserevent/AsyncWriteUserEvent.java new file mode 100644 index 000000000000..605d9fb95535 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/writeuserevent/AsyncWriteUserEvent.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_UserEventService_WriteUserEvent_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.UserEvent; +import com.google.cloud.discoveryengine.v1alpha.UserEventServiceClient; +import com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest; + +public class AsyncWriteUserEvent { + + public static void main(String[] args) throws Exception { + asyncWriteUserEvent(); + } + + public static void asyncWriteUserEvent() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + WriteUserEventRequest request = + WriteUserEventRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setUserEvent(UserEvent.newBuilder().build()) + .build(); + ApiFuture future = + userEventServiceClient.writeUserEventCallable().futureCall(request); + // Do something. + UserEvent response = future.get(); + } + } +} +// [END discoveryengine_v1alpha_generated_UserEventService_WriteUserEvent_async] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/writeuserevent/SyncWriteUserEvent.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/writeuserevent/SyncWriteUserEvent.java new file mode 100644 index 000000000000..c4566cd8db1b --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservice/writeuserevent/SyncWriteUserEvent.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_UserEventService_WriteUserEvent_sync] +import com.google.cloud.discoveryengine.v1alpha.DataStoreName; +import com.google.cloud.discoveryengine.v1alpha.UserEvent; +import com.google.cloud.discoveryengine.v1alpha.UserEventServiceClient; +import com.google.cloud.discoveryengine.v1alpha.WriteUserEventRequest; + +public class SyncWriteUserEvent { + + public static void main(String[] args) throws Exception { + syncWriteUserEvent(); + } + + public static void syncWriteUserEvent() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + WriteUserEventRequest request = + WriteUserEventRequest.newBuilder() + .setParent( + DataStoreName.ofProjectLocationDataStoreName( + "[PROJECT]", "[LOCATION]", "[DATA_STORE]") + .toString()) + .setUserEvent(UserEvent.newBuilder().build()) + .build(); + UserEvent response = userEventServiceClient.writeUserEvent(request); + } + } +} +// [END discoveryengine_v1alpha_generated_UserEventService_WriteUserEvent_sync] diff --git a/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservicesettings/writeuserevent/SyncWriteUserEvent.java b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservicesettings/writeuserevent/SyncWriteUserEvent.java new file mode 100644 index 000000000000..751c88433e00 --- /dev/null +++ b/java-discoveryengine/samples/snippets/generated/com/google/cloud/discoveryengine/v1alpha/usereventservicesettings/writeuserevent/SyncWriteUserEvent.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.discoveryengine.v1alpha.samples; + +// [START discoveryengine_v1alpha_generated_UserEventServiceSettings_WriteUserEvent_sync] +import com.google.cloud.discoveryengine.v1alpha.UserEventServiceSettings; +import java.time.Duration; + +public class SyncWriteUserEvent { + + public static void main(String[] args) throws Exception { + syncWriteUserEvent(); + } + + public static void syncWriteUserEvent() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + UserEventServiceSettings.Builder userEventServiceSettingsBuilder = + UserEventServiceSettings.newBuilder(); + userEventServiceSettingsBuilder + .writeUserEventSettings() + .setRetrySettings( + userEventServiceSettingsBuilder + .writeUserEventSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + UserEventServiceSettings userEventServiceSettings = userEventServiceSettingsBuilder.build(); + } +} +// [END discoveryengine_v1alpha_generated_UserEventServiceSettings_WriteUserEvent_sync] diff --git a/versions.txt b/versions.txt index 1a4a39bf9b6d..2fcc0a24d2a2 100644 --- a/versions.txt +++ b/versions.txt @@ -684,3 +684,5 @@ google-shopping-merchant-reports:0.4.0:0.4.0 proto-google-shopping-merchant-reports-v1beta:0.4.0:0.4.0 grpc-google-shopping-merchant-reports-v1beta:0.4.0:0.4.0 proto-google-cloud-alloydb-connectors-v1:0.6.0:0.6.0 +proto-google-cloud-discoveryengine-v1alpha:0.24.0:0.24.0 +grpc-google-cloud-discoveryengine-v1alpha:0.24.0:0.24.0